Plugin Directory

Changeset 2236496


Ignore:
Timestamp:
01/31/2020 02:36:56 PM (6 years ago)
Author:
pdtasktrack
Message:

version updated

Location:
backupsavvy/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • backupsavvy/trunk/BackUpSavvy.php

    r2127907 r2236496  
    11<?php
    22/**
    3  * Plugin Name: BackupSavvy
     3 * Plugin Name: BackUpSavvy Free
    44 * Plugin URI: https://backupsavvy.com
    55 * Description: WordPress Backup Plugin
    6  * Author: backupsavvy.com.
    7  * Version: 1.0.1
    8  * Domain Path: /
     6 * Author: Backupsavvy.com
     7 * Version: 1.0.6
     8 * Domain Path: https://backupsavvy.com
    99 * Network: true
    10  * License: GPLv3
    11  * License URI: http://www.gnu.org/licenses/gpl-3.0
     10 * License: Backupsavvy
    1211 */
    1312
    14 if ( ! defined( 'ABSPATH' ) ) exit;
     13if (!defined('ABSPATH')) exit;
    1514
    1615// If this file is called directly, abort.
    17 if ( ! defined( 'WPINC' ) ) die;
    18 
    19 define('BACKUPSAVVY_FILE', __FILE__);
    20 
    21 if ( ! class_exists( 'BackUpSavvy', false ) ) {
    22     /**
    23      * Main BackUpSavvy Plugin Class
    24      */
    25     final class BackUpSavvy {
    26         private static $instance = null;
    27 
    28         public function __construct() {
    29             // Nothing else matters if we're not on the main site
    30             if ( ! is_main_network() && ! is_main_site() ) {
    31                 return;
    32             }
    33 
    34             include_once 'inc/BackUpSavvyActivation.php';
    35 
    36             // Deactivation hook
    37             register_deactivation_hook( __FILE__, array('backUpSavvyActivation', 'deactivate' ) );
    38 
    39             $this->activate();
    40 
    41         }
    42 
    43         public function activate() {
    44 
    45     // todo:: add user role protection when ajax reauests
    46             add_action('admin_menu',array(&$this,'register_backup_savvy_custom_menu'),10);
    47 
    48             /*Custom Hooks for style and js files*/
    49             add_action( 'admin_enqueue_scripts', array(&$this, 'register_backup_savvy_scripts') );
    50             add_action( 'wp_ajax_backupsavvy_add_new_job', array(&$this, 'scheduler_job_creator') );
    51 
    52             include_once 'inc/BackUpSavvyBackup.php';
    53             include_once 'inc/BackUpSavvySites.php';
    54             include_once 'inc/BackUpSavvyScheduler.php';
    55             include_once 'inc/BackUpSavvyReports.php';
    56 
    57             new backUpSavvySites();
    58 
    59             $scheduler_jobs = get_option('wpbiu_schedules', array());
    60             if($scheduler_jobs)
    61                 new backUpSavvyScheduler($scheduler_jobs);
    62 
    63 
    64         }
    65 
    66         public function scheduler_job_creator() {
    67 
    68       check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    69       if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) ) {
    70         echo json_encode((object) array('status' => 'nonce'));
     16if (!defined('WPINC')) die;
     17
     18define('BACKUPSAVVY_PLUGIN_PATH', plugin_dir_path(__FILE__));
     19// if BACKUPSAVVY_TEST_MODE == 1, will be used btest branch
     20if(!defined('BACKUPSAVVY_TEST_MODE')) define('BACKUPSAVVY_TEST_MODE', 0);
     21if(!defined('BACKUPSAVVY_BASE_PATH')) define('BACKUPSAVVY_BASE_PATH', __DIR__);
     22
     23if (!class_exists('BackUpSavvy', false)) {
     24  /**
     25   * Main BackUpSavvy Plugin Class
     26   */
     27  final class BackUpSavvy
     28  {
     29    private static $instance = null;
     30
     31    public function __construct()
     32    {
     33      // Nothing else matters if we're not on the main site
     34      if (!is_main_network() && !is_main_site()) {
     35        return;
     36      }
     37
     38      include_once 'inc/BackUpSavvyActivation.php';
     39
     40      // Deactivation hook
     41      register_deactivation_hook(__FILE__, array('backUpSavvyActivation', 'deactivate'));
     42
     43      $this->activate();
     44
     45    }
     46
     47
     48    public function activate()
     49    {
     50
     51      // todo:: add user role protection when ajax requests
     52      add_action('admin_menu', array(&$this, 'register_backup_savvy_custom_menu'), 10);
     53
     54      /*Custom Hooks for style and js files*/
     55      add_action('admin_enqueue_scripts', array(&$this, 'register_backup_savvy_scripts'));
     56      add_action('wp_ajax_backupsavvy_add_new_job', array(&$this, 'scheduler_job_creator'));
     57      add_action( 'admin_init', array(&$this, 'update_database') );
     58
     59      include_once 'inc/BackupSavvyCrud.php';
     60      include_once 'inc/BackUpSavvyBackup.php';
     61      include_once 'inc/pagination.php';
     62      include_once 'inc/BackupSavvyRestore.php';
     63      include_once 'inc/BackUpSavvySites.php';
     64      include_once 'inc/BackUpSavvyScheduler.php';
     65      include_once 'inc/BackUpSavvyReports.php';
     66      include_once 'inc/BackupSavvyStorage.php';
     67      include_once 'inc/BackupSavvyReader.php';
     68
     69      new backUpSavvySites();
     70      new backupSavvyStorage();
     71      new backUpSavvyReports();
     72      new backupSavvyRestore();
     73
     74      $scheduler_jobs = get_option('wpbiu_schedules', array());
     75      if ($scheduler_jobs)
     76        new backUpSavvyScheduler($scheduler_jobs);
     77
     78
     79    }
     80
     81
     82    public function update_database() {
     83      $db_version = get_option('backupsavvy_db_version', 0);
     84      if($db_version !== 0) {
     85        if (version_compare($db_version, '1.1.0', '<')) {
     86          require_once 'inc/BackUpSavvyActivation.php';
     87          backUpSavvyActivation::plugin_update($db_version);
     88        }
     89      } else {
     90        require_once 'inc/BackUpSavvyActivation.php';
     91        backUpSavvyActivation::plugin_update($db_version);
     92      }
     93
     94    }
     95
     96    public function scheduler_job_creator()
     97    {
     98
     99      check_ajax_referer('set-wpbckup_sets', 'nonce');
     100      if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets')) {
     101        echo json_encode((object)array('status' => 'nonce'));
    71102        wp_die();
    72103      }
    73104
    74             $data = array();
    75             parse_str($_POST['data'], $data);
    76             $event_name = $data['title'];
    77 
    78             $days = date("t");
    79             switch ($data['field4']):
    80                 case 'monthly':
    81                     $interval = 60*60*24*$days;
    82                     $interval_name = 'Every month';
    83                     $interval_key = 'every_month';
    84                     break;
    85                 case 'weekly':
    86                     $interval = 60*60*24*7;
    87                     $interval_name = 'Every week';
    88                     $interval_key = 'every_week';
    89                     break;
    90                 case 'daily':
    91                     $interval = 60*60*24;
    92                     $interval_name = 'Once in a day';
    93                     $interval_key = 'every_day';
    94                     break;
    95                 case 'hourly':
    96                     $interval = 60*60;
    97                     $interval_name = 'Once in a hour';
    98                     $interval_key = 'every_hour';
    99                     break;
    100                 case 'test':
    101                     $interval = 60*2;
    102                     $interval_name = 'Once in the two minutes';
    103                     $interval_key = 'every_tow_min';
    104                     break; // for the test every 2 menutes
    105                 default: $interval = 0;
    106             endswitch;
    107 
    108             if($interval) {
    109                 $job = array(
    110                     'id'     => 'backupsavvy_cron_job1',
    111                     'events' => array(
    112                         // hook name => $data
    113                         'creating_sites_backups' => array(
    114                             'interval_key'  => $interval_key,
    115                             'interval_name' => $interval_name,
    116                             'interval'      => $interval,
    117                             'event_name'    => $event_name,
    118                             'method'        => 'create_backup',// callback function
    119                             'args'          => array()
    120                         ),
    121                         'create_backups_after' => array(
    122                             'interval_key'  => 'every_tw_min',
    123                             'interval_name' => 'Every twenty minutes',
    124                             'interval'      => 60*20,
    125                             'event_name'    => 'repeat wrong backups',
    126                             'method'        => 'create_backup_after',// callback function
    127                             'args'          => array()
    128                         )
    129                     ),
    130                     'clear'  => array( // tasks to delation
    131                         'hook_name' => array( 'args' => array() )
    132                     )
    133                 );
    134 
    135                 new backUpSavvyScheduler( $job );
    136 
    137                 backUpSavvyScheduler::activation();
    138             }
    139 
    140             echo json_encode((object) array('status' => 'success'));
    141 
    142             wp_die();
    143         }
    144 
    145         public function register_backup_savvy_custom_menu() {
    146             add_menu_page( 'Wp BackUpSavvy', 'Wp BackUpSavvy', 'manage_options', 'backup-savvy-settings', array(&$this,'backup_savvy_settings'), 'dashicons-welcome-widgets-menus', '30.21');
    147 
    148         }
    149 
    150 
    151 
    152         public function backup_savvy_settings() {
    153             include_once 'parts/settings_page.php';
    154         }
    155 
    156         public static function get_instance() {
    157             if ( null === self::$instance ) {
    158                 self::$instance = new self;
    159             }
    160 
    161             return self::$instance;
    162         }
    163 
    164         /*
    165     Include JS and CSS in Admin Panel
    166     */
    167 
    168         public function register_backup_savvy_scripts($hook)
    169         {
    170             wp_register_style( 'backupsavvy_style', plugins_url( 'assets/backupsavvy_style.css', __FILE__ ));
    171             wp_enqueue_style( 'backupsavvy_style' );
    172 
    173             wp_enqueue_script( 'backupsavvy_js', plugins_url( 'assets/backupsavvy.js', __FILE__ ));
    174             $params = array(
    175                 'nonce' => wp_create_nonce('set-wpbckup_sets'),
    176             );
    177             wp_localize_script( 'backupsavvy_js', 'localVars', $params );
    178         }
    179 
    180     }
    181 
    182     //Start Plugin
    183     add_action( 'plugins_loaded', array( 'BackUpSavvy', 'get_instance' ) );
    184 
    185     function backupsavvy_activation_hook() {
    186         include_once 'inc/BackUpSavvyActivation.php';
    187         backUpSavvyActivation::activate();
    188     }
    189 
    190     register_activation_hook( __FILE__, 'backupsavvy_activation_hook' );
     105      $data = array();
     106      parse_str($_POST['data'], $data);
     107      $event_name = $data['title'];
     108
     109      $days = date("t");
     110      switch ($data['field4']):
     111        case 'monthly':
     112          $interval = 60 * 60 * 24 * $days;
     113          $interval_name = 'Every month';
     114          $interval_key = 'every_month';
     115          break;
     116        case 'weekly':
     117          $interval = 60 * 60 * 24 * 7;
     118          $interval_name = 'Every week';
     119          $interval_key = 'every_week';
     120          break;
     121        case 'daily':
     122          $interval = 60 * 60 * 24;
     123          $interval_name = 'Once in a day';
     124          $interval_key = 'every_day';
     125          break;
     126        case 'hourly':
     127          $interval = 60 * 60;
     128          $interval_name = 'Once in a hour';
     129          $interval_key = 'every_hour';
     130          break;
     131        case 'test':
     132          $interval = 60 * 2;
     133          $interval_name = 'Once in the two minutes';
     134          $interval_key = 'every_tow_min';
     135          break; // for the test every 2 menutes
     136        default:
     137          $interval = 0;
     138      endswitch;
     139
     140      if ($interval) {
     141        $job = array(
     142          'id' => 'backupsavvy_cron_job1',
     143          'events' => array(
     144            // hook name => $data
     145            'creating_sites_backups' => array(
     146              'interval_key' => $interval_key,
     147              'interval_name' => $interval_name,
     148              'interval' => $interval,
     149              'event_name' => $event_name,
     150              'method' => 'create_backup',// callback function
     151              'args' => array()
     152            ),
     153            'create_backups_after' => array(
     154              'interval_key' => 'every_tw_min',
     155              'interval_name' => 'Every twenty minutes',
     156              'interval' => 60 * 20,
     157              'event_name' => 'repeat wrong backups',
     158              'method' => 'create_backup_after',// callback function
     159              'args' => array()
     160            )
     161          ),
     162          'clear' => array( // tasks to delation
     163            'hook_name' => array('args' => array())
     164          )
     165        );
     166
     167        new backUpSavvyScheduler($job);
     168
     169        backUpSavvyScheduler::activation();
     170      }
     171
     172      echo json_encode((object)array('status' => 'success'));
     173
     174      wp_die();
     175    }
     176
     177    public function register_backup_savvy_custom_menu()
     178    {
     179      add_menu_page('Wp BackUpSavvy', 'Wp BackUpSavvy', 'manage_options', 'backup-savvy-settings', array(&$this, 'backup_savvy_settings'), 'dashicons-welcome-widgets-menus', '30.21');
     180
     181    }
     182
     183
     184    public function backup_savvy_settings()
     185    {
     186      include_once 'parts/settings-page.php';
     187    }
     188
     189    public static function get_instance()
     190    {
     191      if (null === self::$instance) {
     192        self::$instance = new self;
     193      }
     194
     195      return self::$instance;
     196    }
     197
     198
     199    private static function get_vars()
     200    {
     201      return (object)array(
     202        'version' => '1.0.6',
     203        'status' => 'free',
     204        'php' => '7.2'
     205      );
     206    }
     207
     208    /*
     209Include JS and CSS in Admin Panel
     210*/
     211
     212    public function register_backup_savvy_scripts($hook)
     213    {
     214//            wp_register_style( 'backupsavvy_admin_bootstrap', plugins_url('assets/bootstrap.min.css', __FILE__));
     215//            wp_enqueue_style('backupsavvy_admin_bootstrap');
     216
     217      wp_register_style('backupsavvy_style', plugins_url('assets/backupsavvy_style.css', __FILE__));
     218      wp_register_style('jbox_style', plugins_url('assets/jBox.all.min.css', __FILE__));
     219      wp_enqueue_style('backupsavvy_style');
     220      wp_enqueue_style('jbox_style');
     221
     222      wp_enqueue_script('backupsavvy_tablesorter_js', plugins_url('assets/jquery.tablesorter.min.js', __FILE__));
     223      wp_enqueue_script('backupsavvy_render_js', plugins_url('assets/backupsavvy-render.js', __FILE__));
     224      wp_enqueue_script('backupsavvy_js', plugins_url('assets/backupsavvy.js', __FILE__));
     225      wp_enqueue_script('backupsavvy_oauth_js', plugins_url('assets/backupsavvy_aouth.js', __FILE__));
     226      wp_enqueue_script('jbox_js', plugins_url('assets/jBox.all.min.js', __FILE__));
     227      wp_enqueue_script('backupsavvy_restore_js', plugins_url('assets/backupsavvy-restore.js', __FILE__));
     228      wp_enqueue_script('sweetalert2_js', plugins_url('assets/sweetalert2.all.min.js', __FILE__));
     229
     230      $params = array(
     231        'nonce' => wp_create_nonce('set-wpbckup_sets'),
     232        'ajax_url' => admin_url('admin-ajax.php'),
     233      );
     234      wp_localize_script('backupsavvy_js', 'localVars', $params);
     235      wp_localize_script('backupsavvy_oauth_js', 'localVars', $params);
     236      wp_localize_script('backupsavvy_restore_js', 'localVars', $params);
     237      wp_localize_script('sweetalert2_js', 'localVars', $params);
     238    }
     239
     240  }
     241
     242  //Start Plugin
     243  add_action('plugins_loaded', array('BackUpSavvy', 'get_instance'));
     244
     245  function backupsavvy_activation_hook()
     246  {
     247    include_once 'inc/BackUpSavvyActivation.php';
     248    backUpSavvyActivation::activate();
     249  }
     250
     251  register_activation_hook(__FILE__, 'backupsavvy_activation_hook');
    191252}
  • backupsavvy/trunk/assets/backupsavvy.js

    r2065940 r2236496  
    22
    33$j(document).ready(function ($) {
     4  BcsvvyVars = {
     5    progress_interval: null
     6  };
     7
     8  BCSVVYadditional = {
     9    num_sites: 50,
     10    page: 1,
     11    name: '',
     12    num_sites_rep: 50,
     13    page_rep: 1,
     14    option: 'sites',
     15    start: 0,
     16    load_sites: function () {
     17      $.post(ajaxurl, {
     18        action: "backupsavvy_load_sites",
     19        method: 'POST',
     20        nonce: localVars.nonce,
     21        number: this.num_sites,
     22        page: this.page,
     23      }, function (response_) {
     24        var response = $.parseJSON(response_);
     25        var container = '.container.sites-list';
     26        $(container).find('.spinner').css('display', 'none');
     27        if(response.sites) {
     28          $('table#sites-list tbody').html('').append(response.sites);
     29          // creating input pull
     30          $('table#sites-list').find('tr').each(function (e) {
     31            if ($(this).find('td.choice input[type="checkbox"]').prop('checked') === true) {
     32              create_inputs($(this).find('td.choice input'));
     33            }
     34            $(this).find('td.choice input').click(function () {
     35              create_inputs(this);
     36            });
     37          });
     38        }
     39        if(response.pager.length > 1) {
     40          $('.tablenav').removeClass('hidden');
     41          $(container).find('.tablenav-pages').html('').append(response.pager);
     42        } else {
     43          $('.tablenav').addClass('hidden');
     44          $('.tablenav-pages').html('')
     45        }
     46      })
     47    },
     48    load_report_list: function () {
     49      $.post(ajaxurl, {
     50        action: "backupsavvy_load_report_list",
     51        method: 'POST',
     52        nonce: localVars.nonce,
     53        number: this.num_sites_rep,
     54        page: this.page_rep,
     55      }, function (response_) {
     56        var response = $.parseJSON(response_);
     57        var container = '.container.existing-list';
     58        $(container).find('.spinner').css('display', 'none');
     59        $('table#existing-backups').append(response.tbody);
     60        if(response.pager.length > 1) {
     61          $('.tablenav').removeClass('hidden');
     62          $(container).find('.tablenav-pages').html('').append(response.pager);
     63        } else {
     64          $('.tablenav').addClass('hidden');
     65          $('.tablenav-pages').html('')
     66        }
     67      })
     68    },
     69    import: function() {
     70      if(this.start === 0) {
     71        var param = {
     72          key: 'start',
     73          title: 'Import progress',
     74          text: 'Import process is started. It can takes some time, please wait'
     75        };
     76        bcsvvNamespace.progress_log(false, param);
     77      }
     78      var obj = this;
     79      $.post(ajaxurl, {
     80        action: "backupsavvy_import_mainwp",
     81        method: 'POST',
     82        start: obj.start,
     83        nonce: localVars.nonce
     84      }, function (response_) {
     85        response = jQuery.parseJSON(response_);
     86        if(response.next !== 'end') {
     87          obj.start = response.next;
     88          bcsvv_render.import(obj, response);
     89          obj.import();
     90        } else {
     91          bcsvv_render.import(obj, response);
     92        }
     93      });
     94    },
     95    filter: function () {
     96      obj = this;
     97        $.post(ajaxurl, {
     98          action: "backupsavvy_filter",
     99          method: 'POST',
     100          option: this.option,
     101          data: this.name,
     102          nonce: localVars.nonce
     103        }, function (response_) {
     104          var response = $.parseJSON(response_);
     105          var container = obj.option === 'report' ? '.container.existing-list' : '.container.sites-list';
     106
     107          $(container).find('.spinner').css('display', 'none');
     108          if(response.sites.length) {
     109            if(obj.option === 'report') {
     110              $(container).find('table#existing-backups tbody').remove().append(response.sites);
     111              $(container).find('table#existing-backups').append(response.sites);
     112            }
     113            else
     114              $(container).find('table#sites-list tbody').html('').append(response.sites);
     115          }
     116        }).fail(function () {
     117          $('.container.sites-list').find('.spinner').css('display', 'none');
     118          alert('Load error, try again later')
     119        })
     120    },
     121    progress_bar_one_process: function(step, parts, limit) {
     122      let width = step;
     123
     124      let param = {};
     125      param.text = width;
     126      param.key = 'one';
     127      if(step === 1) {
     128        param.key = 'start_one';
     129        param.title = 'Backup progress';
     130        param.info = 'Please wait...'
     131      }
     132      if (step === 100)
     133        param.key = 'completed_one';
     134
     135      if(parts.info !== undefined)
     136        param.info = parts.info;
     137
     138      if(step > limit)
     139        clearInterval(BcsvvyVars.progress_interval);
     140
     141      bcsvvNamespace.progress_log(width, param);
     142    },
     143    progress_bar_one: function (parts = null) { // progress bar one
     144      let step = 1;
     145      let limit = 100;
     146      if(parts !== null) {
     147        if(parts.part !== 1) {
     148          step = Math.round(100 / parts.part);
     149          if(BcsvvyVars.progress_interval !== null)
     150            clearInterval(BcsvvyVars.progress_interval);
     151        }
     152        limit = Math.round(100 / parts.parts) * parts.part;
     153        if(limit > 100) limit = 100;
     154        if(parts.key !== undefined)
     155          if(parts.key === 'completed') {
     156            step = 100;
     157            clearInterval(BcsvvyVars.progress_interval);
     158          }
     159      }
     160
     161      this.progress_bar_one_process(step, parts, limit);
     162      let that = this;
     163      BcsvvyVars.progress_interval = setInterval(() => {
     164        step++;
     165        that.progress_bar_one_process(step, parts, limit);
     166
     167      }, 30);
     168    }
     169  }
     170
     171  // sort sites list
     172  $("table#sites-list").tablesorter({
     173    headers: {
     174      3: {
     175        sorter: false
     176      }
     177    }
     178  });
     179
     180  // import mainwp sites
     181  $("form#compare").find("input.import").on("click", function(e) {
     182    e.preventDefault();
     183    BCSVVYadditional.import();
     184  });
     185
     186  // storages settings
     187  $('div.tabs-v button').on('click', function () {
     188    var obj = this;
     189    $(this).addClass('active').siblings().removeClass('active');
     190    var id = $(this).attr('id');
     191    var query = bcsvvNamespace.getQueryParams(document.location.search);
     192    var unique_id = query.unique;
     193    $('.tabcontent#' + id).css('display', 'block').addClass('active').siblings('.tabcontent').css('display', 'none').removeClass('active');
     194    if (!$(this).hasClass('loaded')) {
     195      $.post(ajaxurl, {
     196        action: "backupsavvy_load_storage",
     197        method: 'POST',
     198        id: id,
     199        unique_id: unique_id,
     200        nonce: localVars.nonce
     201      }, function (response_) {
     202        response = $.parseJSON(response_);
     203        $('.tabcontent#' + id).find('.inside').append(response.html);
     204        $(obj).addClass('loaded');
     205        $('.spinner').hide();
     206      });
     207    }
     208  });
    4209
    5210  // tabs settings
     
    13218      $('ul.tabs li.t3').addClass('tab-current');
    14219      break;
     220    case '#list':
     221      $('div.t2').show();
     222      $('ul.tabs li.t2').addClass('tab-current');
     223      if(!$('ul.tabs li.t2').hasClass('loaded'))
     224        BCSVVYadditional.load_sites();
     225      break;
    15226    case '#storage':
    16227      $('div.t4').show();
    17228      $('ul.tabs li.t4').addClass('tab-current');
    18229      break;
    19     case '#list':
    20       $('div.t2').show();
    21       $('ul.tabs li.t2').addClass('tab-current');
     230    case '#existing':
     231      $('div.t5').show();
     232      var t5 = $('ul.tabs li.t5');
     233      t5.addClass('tab-current');
     234      if(!t5.hasClass('loaded'))
     235        t5.addClass('loaded');
     236      BCSVVYadditional.load_report_list();
    22237      break;
    23     case '#backups':
    24       $('div.t5').show();
    25       $('ul.tabs li.t5').addClass('tab-current');
    26       break;
    27     case '#update':
     238    case '#logs':
    28239      $('div.t6').show();
    29240      $('ul.tabs li.t6').addClass('tab-current');
     
    41252    $j('ul.tabs li').removeClass('tab-current');
    42253    $j(this).addClass('tab-current');
     254    if($(this).hasClass('list')) {
     255      if(!$(this).hasClass('loaded')) {
     256        $(this).addClass('loaded');
     257        BCSVVYadditional.load_sites();
     258      }
     259    }
     260    if($(this).hasClass('existing')) {
     261      if(!$(this).hasClass('loaded')) {
     262        $(this).addClass('loaded');
     263        BCSVVYadditional.load_report_list();
     264      }
     265    }
     266  });
     267
     268  // filter
     269  $('.sites-list table.top-options').find('form.filter').on('click', 'input[name="filter"]', function(e) {
     270    e.preventDefault();
     271    $(this).closest('table').find('.spinner').css('display', 'block');
     272    BCSVVYadditional.name = $(this).closest('td').find('input[name=site]').val();
     273    BCSVVYadditional.filter();
     274  });
     275
     276  $('.existing-backups table.top-options').find('form.filter').on('click', 'input[name="filter"]', function(e) {
     277    e.preventDefault();
     278    $(this).closest('table').find('.spinner').css('display', 'block');
     279    BCSVVYadditional.name = $(this).closest('td').find('input[name=site]').val();
     280    BCSVVYadditional.option = 'report';
     281    BCSVVYadditional.filter();
     282  });
     283
     284  // sites per page
     285  $('.sites-list table.top-options').find('td.per-page').on('click', 'span:not(.per-page):not(.current)', function () {
     286    $(this).closest('table').find('.spinner').css('display', 'block');
     287    $(this).toggleClass('current').siblings('span').removeClass('current');
     288    BCSVVYadditional.page = 1;
     289    BCSVVYadditional.num_sites = parseInt($(this).attr('data-num'));
     290    BCSVVYadditional.load_sites();
     291  });
     292
     293  // reports pre page
     294  $('.existing-backups table.top-options').find('td.per-page').on('click', 'span:not(.per-page):not(.current)', function () {
     295    $(this).closest('table').find('.spinner').css('display', 'block');
     296    $(this).toggleClass('current').siblings('span').removeClass('current');
     297    $('table#existing-backups tbody').remove();
     298    BCSVVYadditional.page_rep = 1;
     299    BCSVVYadditional.num_sites_rep = parseInt($(this).attr('data-num'));
     300    BCSVVYadditional.load_report_list();
     301  });
     302
     303  // sites' pager
     304  $('.container.sites-list .tablenav').on('click', '.tablenav-pages a', function (e) {
     305    e.preventDefault();
     306    $(this).closest('.container').find('table.top-options').find('.spinner').css('display', 'block');
     307    BCSVVYadditional.page = parseInt($(this).attr('data-num'));
     308    BCSVVYadditional.load_sites();
     309  });
     310
     311  // reports' pager
     312  $('.container.existing-list .tablenav').on('click', '.tablenav-pages a', function (e) {
     313    e.preventDefault();
     314    var container = $(this).closest('.container');
     315    container.find('table.top-options').find('.spinner').css('display', 'block');
     316    container.find('table#existing-backups tbody').remove();
     317    BCSVVYadditional.page_rep = parseInt($(this).attr('data-num'));
     318    BCSVVYadditional.load_report_list();
    43319  });
    44320
     
    46322    $(this).next('form').toggle('slow');
    47323  });
     324
     325  // google cloud
     326  $('#google .inside').on('change', '.bcsvvy-upload-json input[type=file]', function (e) {
     327    e.stopPropagation();
     328    e.preventDefault();
     329    var files = this.files;
     330    if (typeof files == 'undefined') return;
     331
     332    var data = new FormData();
     333
     334    $.each(files, function (key, value) {
     335      data.append(key, value);
     336    });
     337
     338    data.append('action', 'bcsvvy_upload_json');
     339
     340    $.ajax({
     341      url: localVars.ajax_url,
     342      type: 'POST',
     343      data: data,
     344      cache: false,
     345      dataType: 'json',
     346      processData: false,
     347      contentType: false,
     348      success: function (respond, status, jqXHR) {
     349
     350        if (typeof respond.error === 'undefined') {
     351          if (respond.response === 'success') {
     352            // check if post id
     353            // connect to cloud
     354            // append buckets
     355          }
     356        }
     357        else {
     358          console.log('Error: ' + respond.error);
     359        }
     360      },
     361
     362      error: function (jqXHR, status, errorThrown) {
     363        console.log('AJAX error: ' + status, jqXHR);
     364      }
     365
     366    });
     367    return false;
     368  });
     369
     370
     371  BCSVVY = {
     372    step: 1,
     373    form: '',
     374    id: [],
     375    unique: 0,
     376    active: '',
     377    total: 0,
     378    caller: '',
     379    length_id: 0,
     380    add_scheduler_job: function () {
     381      $.post(ajaxurl, {
     382        action: "backupsavvy_add_new_job",
     383        method: 'POST',
     384        data: this.form,
     385        nonce: localVars.nonce
     386      }, function (response_) {
     387        response = $.parseJSON(response_);
     388        bcsvv_render.add_scheduler_job(false, response);
     389      });
     390    },
     391    save_backup_settings: function () {
     392      var form = this.form;
     393      var obj = this;
     394      this.active = 'save_backup_settings';
     395      $.post(ajaxurl, {
     396        action: "backupsavvy_save_backup_settings",
     397        method: 'POST',
     398        data: form,
     399        nonce: localVars.nonce
     400      }, function (response_) {
     401        response = jQuery.parseJSON(response_);
     402        bcsvv_render.save_backup_settings(obj, response);
     403      });
     404    },
     405    save_ftp_storage: function () {
     406      var form = this.form;
     407      var obj = this;
     408      this.active = 'save_storage';
     409      // $('#backupsavvy-settings > .overlay').show();
     410      // $('#progresssteps').parent('.progressbar').show();
     411      $.post(ajaxurl, {
     412        action: "backupsavvy_save_storage",
     413        method: 'POST',
     414        data: form,
     415        nonce: localVars.nonce
     416      }, function (response_) {
     417        response = jQuery.parseJSON(response_);
     418        bcsvv_render.save_ftp_storage(obj, response);
     419        console.log(response.status);
     420      });
     421    },
     422    save_dropbox_storage: function () {
     423      var form = this.form;
     424      var obj = this;
     425      this.active = 'save_storage';
     426      $.post(ajaxurl, {
     427        action: "backupsavvy_save_storage",
     428        method: 'POST',
     429        data: form,
     430        nonce: localVars.nonce
     431      }, function (response_) {
     432        response = jQuery.parseJSON(response_);
     433        bcsvv_render.save_dropbox_storage(obj, response);
     434        console.log(response.status);
     435      });
     436    },
     437    save_google_storage: function() {
     438      var form = this.form;
     439      var obj = this;
     440      this.active = 'save_storage';
     441      $.post(ajaxurl, {
     442        action: "backupsavvy_save_storage",
     443        method: 'POST',
     444        data: form,
     445        nonce: localVars.nonce
     446      }, function (response_) {
     447        response = jQuery.parseJSON(response_);
     448        bcsvv_render.save_google_storage(obj, response);
     449        console.log(response.status);
     450      });
     451    },
     452    set_default: function () {
     453      var form = this.form;
     454      var unique = this.id[0];
     455      $.post(ajaxurl, {
     456        action: "backupsavvy_set_default",
     457        method: 'POST',
     458        unique: unique,
     459        nonce: localVars.nonce
     460      }, function (response_) {
     461        response = jQuery.parseJSON(response_);
     462        bcsvv_render.set_default(false, response);
     463      });
     464    },
     465    set_default: function () {
     466      var form = this.form;
     467      var unique = this.id[0];
     468      $.post(ajaxurl, {
     469        action: "backupsavvy_set_default",
     470        method: 'POST',
     471        unique: unique,
     472        nonce: localVars.nonce
     473      }, function (response_) {
     474        response = jQuery.parseJSON(response_);
     475        bcsvv_render.set_default(false, response);
     476      });
     477    },
     478    test_con: function () {
     479      var form = this.form;
     480      $.post(ajaxurl, {
     481        action: "backupsavvy_test_con",
     482        method: 'POST',
     483        data: form
     484      }, function (response_) {
     485        response = jQuery.parseJSON(response_);
     486        bcsvv_render.test_con(false, response);
     487      });
     488    },
     489    sync_one: function () {
     490      var obj = this;
     491      if (this.caller === 'sync_options')
     492        obj.length_id = this.id.length;
     493      else
     494        bcsvvNamespace.enable_preloader();
     495      $.post(ajaxurl, {
     496        action: "backupsavvy_sync_one",
     497        method: 'POST',
     498        id: this.id[0],
     499        nonce: localVars.nonce
     500      }, function (response_) {
     501        response = jQuery.parseJSON(response_);
     502        bcsvv_render.sync_one(obj, response);
     503      });
     504    },
     505    sync: function () { // syncing settings for all sites
     506      var obj = this;
     507      this.caller = 'sync';
     508      if (this.step === 1) {
     509        var param = {
     510          key: 'start',
     511          title: 'Backup progress',
     512          text: 'Syncing process is started. It can takes some time, please wait'
     513        };
     514        bcsvvNamespace.progress_log(false, param);
     515      }
     516      $.post(ajaxurl, {
     517        action: "backupsavvy_sync_process",
     518        method: 'POST',
     519        step: obj.step,
     520        nonce: localVars.nonce
     521      }, function (response_) {
     522        response = jQuery.parseJSON(response_);
     523        bcsvv_render.sync(obj, response);
     524      });
     525    },
     526    backup_one: function () {
     527      this.active = 'backup_one';
     528      var obj = this;
     529      var id = this.id[0];
     530      if (this.caller === 'backup_options') {
     531        if (obj.length_id <= obj.id.length)
     532          obj.length_id = obj.length_id + 1;
     533        id = this.id[obj.length_id - 1];
     534      }
     535      // else
     536      //   bcsvvNamespace.enable_preloader();
     537      $.post(ajaxurl, {
     538        action: "backupsavvy_backup_one",
     539        method: 'POST',
     540        data: id,
     541        nonce: localVars.nonce
     542      }, function (response_) {
     543        response = $.parseJSON(response_);
     544        console.log('response');
     545        console.log(response);
     546        bcsvv_render.backup_one(obj, response);
     547      }).fail(function () {
     548        response = {
     549          status: 'error',
     550          site: response.toString(),
     551          step: obj.step + 1
     552        };
     553        bcsvv_render.backup(obj, response);
     554      });
     555    },
     556    upload_one: function () {
     557      this.active = 'upload_one';
     558      var obj = this;
     559      var id = this.id[0];
     560      if (obj.caller === 'backup_options')
     561        id = this.id[obj.length_id - 1];
     562      $.post(ajaxurl, {
     563        action: "backupsavvy_upload_one",
     564        method: 'POST',
     565        data: id,
     566        nonce: localVars.nonce
     567      }, function (response_) {
     568        response = $.parseJSON(response_);
     569        bcsvv_render.upload_one(obj, response);
     570      }).fail(function () {
     571        response = {status: 'error', site: 'backup '};
     572        bcsvv_render.upload_one(obj, response);
     573      });
     574    },
     575    backup: function () {
     576      this.caller = 'backup';
     577      var obj = this;
     578      if (this.step === 1) {
     579        var param = {
     580          key: 'start',
     581          title: 'Backup progress',
     582          text: 'Backup process is started. It can takes some time, please wait'
     583        }
     584        bcsvvNamespace.progress_log(false, param);
     585      }
     586      console.log('step=' + obj.step);
     587      $.post(ajaxurl, {
     588        action: 'backupsavvy_backup_process',
     589        method: 'POST',
     590        step: this.step,
     591        nonce: localVars.nonce
     592      }, function (response_) {
     593        response = $.parseJSON(response_);
     594        bcsvv_render.backup(obj, response);
     595      }).fail(function () {
     596        response = {
     597          status: 'error',
     598          site: 'backup ',
     599          step: obj.step + 1
     600        };
     601        bcsvv_render.backup(obj, response);
     602      });
     603    },
     604    upload: function () {
     605      this.caller = 'upload';
     606      var obj = this;
     607      $.post(ajaxurl, {
     608        action: 'backupsavvy_upload_one',
     609        method: 'POST',
     610        data: obj.id[0],
     611        nonce: localVars.nonce
     612      }, function (response_) {
     613        response = $.parseJSON(response_);
     614        bcsvv_render.upload(obj, response);
     615      }).fail(function () {
     616        response = {status: 'error', site: 'backup '};
     617        bcsvv_render.upload(obj, response);
     618      });
     619    },
     620    remove_one: function () {
     621      obj = this;
     622      $.post(ajaxurl, {
     623        action: 'backupsavvy_remove_site',
     624        method: 'POST',
     625        id: this.id[0],
     626        nonce: localVars.nonce
     627      }, function (response_) {
     628        response = $.parseJSON(response_);
     629        bcsvv_render.remove_one(obj, response);
     630      })
     631    },
     632    add_site: function () {
     633      obj = this;
     634      $("form#settings .spinner").css('display', 'inline-block');
     635      $.post(ajaxurl, {
     636        action: "backupsavvy_add_new_site",
     637        method: 'POST',
     638        data: this.form,
     639        nonce: localVars.nonce
     640      }, function (response_) {
     641        response = jQuery.parseJSON(response_);
     642        bcsvv_render.add_site(obj, response);
     643      });
     644      return false;
     645    },
     646    sync_options: function () {
     647      bcsvvNamespace.progress_log(false, {
     648        key: 'start',
     649        title: 'Sync progress',
     650        text: 'Sync process is started. It can takes some time, please wait'
     651      });
     652      this.sync_one();
     653    },
     654    backup_options: function () {
     655      bcsvvNamespace.progress_log(false, {
     656        key: 'start',
     657        title: 'Backup progress',
     658        text: 'Backup process is started. It can takes some time, please wait'
     659      });
     660      this.backup_one();
     661    },
     662    backup_download: function () {
     663      var obj = this;
     664      $.post(ajaxurl, {
     665        action: "backupsavvy_download_backup",
     666        method: 'POST',
     667        id: this.id,
     668        unique: this.unique,
     669        nonce: localVars.nonce
     670      }, function (response_) {
     671        var response = jQuery.parseJSON(response_);
     672        if (response.status === 'success')
     673          window.location.href = window.location.host +
     674            '/wp-admin/admin.php?page=backup-savvy-settings&backup-file=' + response.name;
     675        $('table#existing').find('tr td.action > .btn').each(function() {
     676          $(this).removeClass('disable');
     677        });
     678      });
     679    },
     680    save_ftp_unique: function() {
     681      let form = this.form;
     682      let unique = this.unique;
     683      $.post(ajaxurl, {
     684        action: "backupsavvy_save_ftp_unique",
     685        method: 'POST',
     686        unique: unique,
     687        data: form,
     688        nonce: localVars.nonce
     689      }, function (response_) {
     690        var response = jQuery.parseJSON(response_);
     691        if(response.status === "site_ftp")
     692          tb_show( 'Add FTP data of the site to need restore', '/?TB_inline&inlineId=ftp-unique-settings&width=700&height=500' );
     693
     694        if (response.status === 'success')
     695          alert('Saved');
     696
     697        $('table#existing').find('tr td.action > .btn').removeClass('disable');
     698      });
     699    },
     700    log_process: function () {
     701      $.post(ajaxurl, {
     702        action: "backupsavvy_log_process",
     703        method: 'POST',
     704        data: this.form,
     705        nonce: localVars.nonce
     706      }, function (response_) {
     707        var response = jQuery.parseJSON(response_);
     708        if (response.status === 'success')
     709          $('.logs .inside').append(response.result);
     710        //     window.location.href = window.location.host +
     711        //         '/wp-admin/admin.php?page=backup-savvy-settings&'+response.action;
     712        $('table#existing').find('tr td.action > .btn').removeClass('disable');
     713      });
     714    },
     715    compare: function () {
     716      $.post(ajaxurl, {
     717        action: "backupsavvy_compare",
     718        method: 'POST',
     719        data: this.form,
     720        nonce: localVars.nonce
     721      }, function (response_) {
     722        console.log(response_)
     723        var response = jQuery.parseJSON(response_);
     724        var result = '';
     725        $.each(response, function (i, v) {
     726          result = result + "\n" + v;
     727        })
     728        $('form#compare').find('textarea#result').val(result);
     729      });
     730    }
     731  };
     732
     733  // count sites
     734  $.post(ajaxurl, {
     735    action: "backupsavvy_count_sites",
     736    method: 'POST',
     737    nonce: localVars.nonce
     738  }, function (response_) {
     739    response = jQuery.parseJSON(response_);
     740    BCSVVY.total = parseInt(response.number);
     741  });
     742
     743  // main wp integration
     744  $('form#compare').on('click', 'input.compare', function (e) {
     745    e.preventDefault();
     746    BCSVVY.form = split_textarea($(this).closest('form'));
     747    BCSVVY.compare();
     748  });
     749
     750  function split_textarea(obj) {
     751    var lines = obj.find('textarea#list').val().replace(/^[\n\r]+|[\n\r]+$/g, '').split(/[\n\r]+/);
     752
     753    return lines;
     754  }
     755
     756  // add new site
     757  $('#backupsavvy-settings:not(.single)').on('click', 'form#settings input[type="submit"]', bcsvvNamespace.click_add);
     758
     759  $('#backupsavvy-settings:not(.single)').on('click', 'input[name="settings_save"]', bcsvvNamespace.click_save_backup);
     760  $('#backupsavvy-settings').on('click', 'input[name="ftp_save"]', bcsvvNamespace.click_ftp_storage);
     761  $('#backupsavvy-settings').on('click', 'input[name="dropbox_save"]', bcsvvNamespace.click_save_dropbox);
     762  // $('#backupsavvy-settings').on('click', 'input[name="google_save"]', bcsvvNamespace.click_save_google);
     763  $('#backupsavvy-settings').on('click', 'button#test-con', bcsvvNamespace.click_test_con);
     764
     765  // single requests
     766  $('#backupsavvy-settings.single').on('click', 'button#make-default', bcsvvNamespace.click_set_default);
     767  $('#backupsavvy-settings.single').on('click', 'input[name=settings_save]', bcsvvNamespace.click_save_backup);
     768
     769
     770  // bulk operations
     771
     772  // sync
     773  $('#backupsavvy-settings').on('click', '#bulk-op a.bulk-sync', bcsvvNamespace.click_sync);
     774
     775  // all backups
     776  $('#backupsavvy-settings').on('click', '#bulk-op a.bulk-backup', bcsvvNamespace.click_backup);
     777
     778  // create one backup/sync/remove
     779  var sites_list = 'table#sites-list';
     780  var action = 'tr td.action'
     781  $(sites_list).on('click', action + ' a.backup.btn', bcsvvNamespace.click_backup_one);
     782  $(sites_list).on('click', action + ' a.sync.btn', bcsvvNamespace.click_sync_one);
     783  $(sites_list).on('click', action + ' a.remove.btn', bcsvvNamespace.click_remove_one);
     784
     785
     786  $('#backupsavvy-settings').find('.overlay').on('click', '.stop', function () {
     787    window.location.reload();
     788  });
     789
     790  var inputs = {};
     791  var i = 0;
     792  function create_inputs(object) {
     793    var id = $(object).closest('tr').find('td.action div.hidden').attr('id');
     794    if ($(object).prop('checked') === true) {
     795      var inp = document.createElement("input");
     796      inp.setAttribute('type', 'hidden');
     797      inp.setAttribute('value', id);
     798      inp.setAttribute('name', 'id[' + i + ']');
     799      inputs[id] = id;
     800      i++;
     801    } else {
     802      delete inputs[id];
     803    }
     804
     805    var size = Object.keys(inputs).length;
     806    var sbm = $('#backupsavvy-settings #bulk-op').find('form#bulk input[type="submit"]');
     807    if (size > 0) {
     808      sbm.removeClass('disable').removeAttr('disabled');
     809    } else {
     810      sbm.attr('disabled', 'disabled');
     811      sbm.addClass('disable');
     812    }
     813  }
     814
     815  $('#backupsavvy-settings #bulk-op').on('submit', 'form', function (e) {
     816    e.stopPropagation();
     817    e.preventDefault();
     818    var size = Object.keys(inputs).length;
     819    if (size > 0) {
     820      var select = $(this).find('select option:selected').val();
     821      BCSVVY.id = Object.values(inputs);
     822      console.log('bid=' + BCSVVY.id);
     823      if (select === 'sync') {
     824        BCSVVY.caller = 'sync_options';
     825        BCSVVY.sync_options();
     826      }
     827      if (select === 'backup') {
     828        BCSVVY.caller = 'backup_options';
     829        BCSVVY.backup_options();
     830      }
     831    }
     832  });
     833
    48834
    49835  // add new job
    50836  $('#add-new-job form').on('submit', function (e) {
    51837    e.stopPropagation();
     838    bcsvvNamespace.disable_button($(this).find('input[type="submit"]'));
    52839    $(".spinner").css('visibility', 'visible');
    53     var form_data = $(this).serialize();
    54     $.post(ajaxurl, {
    55       action: "backupsavvy_add_new_job",
    56       method: 'POST',
    57       data: form_data,
    58       nonce: localVars.nonce
    59     }, function (response_) {
    60       response = $.parseJSON(response_);
    61       if(response.status === 'nonce') {
    62         alert('Validation error!')
    63       }
    64       if(response.status === 'success') {
    65         alert('The job has been created');
    66       }
    67       $('#add-new-job form').toggle();
    68       window.location.reload();
    69     });
     840    BCSVVY.form = $(this).serialize();
     841    BCSVVY.add_scheduler_job();
    70842    return false;
    71843  });
    72844
    73   WPB_ITUP = {
    74     step: 1,
    75     form: '',
    76     id: 0,
    77     active: '',
    78     total: 0,
    79     caller: '',
    80     api: '',
    81     save_storage: function () {
    82       var form = this.form;
    83       var obj = this;
    84       this.active = 'save_storage';
    85       $('#backupsavvy-settings > .overlay').show();
    86       $('#progresssteps').parent('.progressbar').show();
    87       $.post(ajaxurl, {
    88         action: "backupsavvy_save_storage",
    89         method: 'POST',
    90         data: form,
    91         nonce: localVars.nonce
    92       }, function (response_) {
    93         response = jQuery.parseJSON(response_);
    94         console.log(response.status);
    95         if (response.status == 'success') {
    96           obj.sync();
    97           return false;
    98         }
    99         if(response.status === 'nonce') {
    100           alert('Validation error!');
    101         }
    102         enable_button('input[name="ftp_save"]', click_save_storage);
    103         $('div.t4 #progresssteps').parent('.progressbar').hide();
    104         if (response.status === 'field') {
    105           alert('All fields must be filled');
    106         }
    107 
    108         if (response.status === 'nodir') {
    109           alert('Directory doesn\'t exists!');
    110         }
    111         if (response.status === 'error') {
    112           alert('Did not save! Check your settings please');
    113         }
    114       });
    115     },
    116     set_unique: function () {
    117       var form = this.form;
    118       $.post(ajaxurl, {
    119         action: "backupsavvy_unique_settings",
    120         method: 'POST',
    121         data: form,
    122         unique: this.id,
    123         nonce: localVars.nonce
    124       }, function (response_) {
    125         response = jQuery.parseJSON(response_);
    126         enable_button('input[name="ftp_save"]', click_set_unique);
    127         if (response.status === 'success') {
    128           alert('Saved!');
    129         }
    130         else if(response.status === 'nonce') {
    131           alert('Validation error!');
    132         }
    133         else {
    134           alert('Not saved, check your settings');
    135         }
    136       });
    137     },
    138     set_default: function () {
    139       var form = this.form;
    140       var unique = this.id;
    141       console.log(unique)
    142       $.post(ajaxurl, {
    143         action: "backupsavvy_set_default",
    144         method: 'POST',
    145         data: form,
    146         unique: unique,
    147         nonce: localVars.nonce
    148       }, function (response_) {
    149         response = jQuery.parseJSON(response_);
    150         enable_button('button#make-default', click_set_default);
    151         if (response.status === 'success') {
    152           alert('Saved!');
    153         }
    154         else if(response.status === 'nonce') {
    155           alert('Validation error');
    156         }
    157         else {
    158           alert('Not saved, check your settings');
    159         }
    160       });
    161     },
    162     test_con: function () {
    163       var form = this.form;
    164       $.post(ajaxurl, {
    165         action: "backupsavvy_test_con",
    166         method: 'POST',
    167         data: form
    168       }, function (response_) {
    169         response = jQuery.parseJSON(response_);
    170         enable_button('button#test-con', click_test_con)
    171         if (response.status === 'success') {
    172           alert('Connected!');
    173         }
    174         else if (response.status === 'nodir') {
    175           alert('Directory doesn\'t exists!');
    176         }
    177         else {
    178           alert('Not connected, check your settings');
    179         }
    180       });
    181     },
    182     sync_one: function () {
    183       var obj = this;
    184       $.post(ajaxurl, {
    185         action: "backupsavvy_sync_one",
    186         method: 'POST',
    187         id: this.id,
    188         nonce: localVars.nonce
    189       }, function (response_) {
    190         response = jQuery.parseJSON(response_);
    191         var td = $('table#sites-list').find('#' + obj.id).closest('td');
    192         if (response.status === 'success') {
    193           td.find('.spinner').hide();
    194           enable_button(td.find('a.sync')[0]);
    195           alert('Storage settings synced');
    196         }
    197         else {
    198           td.find('.spinner').hide();
    199           enable_button(td.find('a.sync')[0]);
    200           alert('Something wrong, try again later! ' + response.status);
    201         }
    202       });
    203     },
    204     sync: function () { // syncing settings for all sites
    205       var obj = this;
    206       var overlay = $('#backupsavvy-settings > .overlay');
    207       overlay.show();
    208       overlay.find('h3').text('Sync progress');
    209       var progress = $('#progresssteps');
    210       progress.parent('.progressbar').show();
    211       $.post(ajaxurl, {
    212         action: "backupsavvy_sync_process",
    213         method: 'POST',
    214         step: obj.step,
    215         nonce: localVars.nonce
    216       }, function (response_) {
    217         response = jQuery.parseJSON(response_);
    218         obj.step = response.step;
    219         var total = response.total;
    220         var curent_site = response.site;
    221         if(response.status === 'nonce') {
    222           alert('Validation error');
    223           window.location.reload();
    224         }
    225         if (total === 'completed') {
    226           progress.css('width', '100%');
    227           overlay.find('.info').prepend('Completed! <br>' + curent_site + ' is synced.<br>');
    228           progress.text('100%').parent().hide();
    229           overlay.hide();
    230           if (obj.active === 'save_storage') {
    231             enable_button('input[name="ftp_save"]', click_save_storage);
    232           }
    233           else {
    234             enable_button('#backupsavvy-settings #bulk-op a.bulk-sync', click_sync);
    235           }
    236           return false;
    237         }
    238         var width = Math.round((response.step - 1) * 100 / total);
    239         overlay.find('.info').prepend(curent_site + ' is synced.<br>');
    240         progress.css('width', width + '%');
    241         progress.text(width + '% / 100%');
    242         obj.sync();
    243       });
    244     },
    245     backup_one: function () {
    246       var obj = this;
    247       $.post(ajaxurl, {
    248         action: "backupsavvy_backup_one",
    249         method: 'POST',
    250         data: this.id,
    251         nonce: localVars.nonce
    252       }, function (response_) {
    253         response = $.parseJSON(response_);
    254         if (response.status === 'nonce') {
    255           $(".spinner").hide();
    256           enable_button('a.backup.btn', click_backup_one);
    257           alert('Validation error');
    258         } else if (response.status === 'success') {
    259           console.log('backup created for ' + response.url);
    260           obj.upload_one();
    261         } else {
    262           console.log(response.status);
    263           $(".spinner").hide();
    264           enable_button('a.backup.btn', click_backup_one);
    265           alert('Something went wrong. Try again later');
    266         }
    267 
    268       });
    269     },
    270     upload_one: function () {
    271       $.post(ajaxurl, {
    272         action: "backupsavvy_upload_one",
    273         method: 'POST',
    274         data: this.id,
    275         nonce: localVars.nonce
    276       }, function (response_) {
    277         response = $.parseJSON(response_);
    278         if (response.status === 'nonce') {
    279           alert('Validation error');
    280         }
    281         $(".spinner").hide();
    282         enable_button('a.backup.btn', click_backup_one);
    283         if (response.status === 'success') {
    284           console.log('backup uploaded: ' + response.url);
    285           alert('Backup created for ' + response.site);
    286         }
    287       });
    288     },
    289     backup: function () {
    290       this.caller = 'backup';
    291       var obj = this;
    292       if (this.step === 1) {
    293         var param = {
    294           key: 'start',
    295           title: 'Backtup progress',
    296           text: 'Backup process is started. It can takes some time, please wait'
    297         }
    298         progress_log(false, param);
    299       }
    300       $.post(ajaxurl, {
    301         action: 'backupsavvy_backup_process',
    302         method: 'POST',
    303         step: this.step,
    304         nonce: localVars.nonce
    305       }, function (response_) {
    306         response = $.parseJSON(response_);
    307         var param = {key: ''};
    308         var total = response.total;
    309         obj.step = response.step;
    310         obj.total = total;
    311         obj.id = response.id;
    312         console.log('total ' + total);
    313         console.log('set id ' + obj.id);
    314         obj.step = response.step;
    315         if (response.status === 'success') {
    316           var width = Math.round((response.step - 1) * 100 / total);
    317           param = {
    318             action: 'info',
    319             current_site: response.site,
    320             text: 'backup created'
    321           };
    322           progress_log(width, param);
    323 
    324           obj.upload();
    325         }
    326         else if (response.status === 'completed') {
    327           obj.status = 'completed';
    328           var width = Math.round((response.step - 1) * 100 / total);
    329           param = {
    330             key: 'info',
    331             current_site: response.site,
    332             text: 'backup created'
    333           };
    334           progress_log(width, param);
    335           obj.upload();
    336         }
    337         else {
    338           var width = Math.round((response.step - 1) * 100 / total);
    339           param = {
    340             current_site: response.site,
    341             text: '<span class="red">backup error</span>'
    342           };
    343           progress_log(width, param);
    344           obj.backup();
    345         }
    346       })
    347     },
    348     upload: function () {
    349       this.caller = 'upload';
    350 
    351       console.log('get id ' + this.id);
    352       var obj = this;
    353       $.post(ajaxurl, {
    354         action: 'backupsavvy_upload_one',
    355         method: 'POST',
    356         data: this.id,
    357         nonce: localVars.nonce
    358       }, function (response_) {
    359         response = $.parseJSON(response_);
    360         var total = obj.total;
    361         var current_site = response.site;
    362         var width = Math.round((obj.step - 1) * 100 / total);
    363         var param = {key: ''};
    364 
    365         if (obj.status === 'completed') {
    366           param = {
    367             current_site: '',
    368             text: 'Completed!<br>' + current_site + ' uploaded to vault',
    369             key: 'completed'
    370           };
    371           progress_log(100, param);
    372           enable_button('#bulk-op .bulk-backup', click_backup);
    373           return false;
    374         }
    375         if (response.status === 'success') {
    376           param = {
    377             current_site: current_site,
    378             text: 'uploaded to vault',
    379             title: 'Backup progress'
    380           };
    381 
    382           progress_log(width, param);
    383 
    384           obj.backup();
    385         }
    386         else {
    387           param = {
    388             current_site: current_site,
    389             text: '<span class="red">uploading error</span>',
    390             title: 'Backup progress'
    391           };
    392           progress_log(width, param);
    393 
    394           obj.backup();
    395 
    396         }
    397 
    398       })
    399     },
    400     remove_one: function () {
    401       obj = this;
    402       $.post(ajaxurl, {
    403         action: 'backupsavvy_remove_site',
    404         method: 'POST',
    405         id: this.id,
    406         nonce: localVars.nonce
    407       }, function (response_) {
    408         response = $.parseJSON(response_);
    409         if (response.status === 'success') {
    410           window.location.reload();
    411         }
    412         else if(response.status === 'nonce') {
    413           alert('Validation error');
    414         }
    415         else {
    416           alert('Something wrong');
    417         }
    418         var td = $('table#sites-list').find('#' + obj.id).closest('td');
    419       })
    420     },
    421     add_site: function () {
    422       obj = this;
    423       $("form#settings .spinner").css('display', 'inline-block');
    424       $.post(ajaxurl, {
    425         action: "backupsavvy_add_new_site",
    426         method: 'POST',
    427         data: this.form,
    428         nonce: localVars.nonce
    429       }, function (response_) {
    430         response = jQuery.parseJSON(response_);
    431         $("form#settings .spinner").hide();
    432         enable_button('#settings input.btn', click_add);
    433         if (response.status === 'error') {
    434           alert('Error! Check your data');
    435         }
    436         if (response.status === 'error_exists') {
    437           alert('The site already exists!')
    438         }
    439         if (response.status === 'error_protecion') {
    440           alert('Check your secret!')
    441         }
    442         if (response.status === 'success') {
    443           alert('Site has been added!');
    444           $('form#settings').trigger("reset");
    445         }
    446       });
     845  // download backup
     846  var existing_list = 'table#existing-backups';
     847  var action = 'td.action';
     848  $(existing_list).on('click', action + ' .btn.download', function() {
     849    if ($(this).hasClass('disable'))
    447850      return false;
    448     },
    449     premium_update: function () {
    450       var spinner = $('.do-update').find('.spinner');
    451       spinner.css({
    452         display: 'inline-block',
    453         position: 'relative',
    454         top: '-34px'});
    455 
    456       $.post(ajaxurl, {
    457         action: "backupsavvy_premium_update",
    458         method: 'POST',
    459         data: this.api,
    460         nonce: localVars.nonce
    461       }, function (response_) {
    462         var response = jQuery.parseJSON(response_);
    463         if (response.status === 'ok')
    464           $.post(ajaxurl, {
    465             action: 'backupsavvy_replace_plugin',
    466             method: 'POST',
    467             nonce: localVars.nonce
    468           },
    469           function (response) {
    470             console.log(response);
    471             console.log($(response).filter('span.code'));
    472             spinner.css('display', 'none');
    473             window.location.reload();
    474           });
    475         else {
    476           spinner.css('display', 'none');
    477           alert(response.status);
    478         }
    479         console.log(response);
    480 
    481       });
    482     }
    483   }
    484 
    485 
    486   function progress_log(width, param) {
    487     var progress = $('#progresssteps');
    488     var overlay = $('#backupsavvy-settings > .overlay');
    489     var caller = WPB_ITUP.caller;
    490 
    491     if (param.key === 'start') {
    492       progress.css('width', '0');
    493       progress.text('0%');
    494       progress.parent('.progressbar').show();
    495       overlay.find('h3').text(param.title);
    496       overlay.find('.info').prepend(param.text);
    497       overlay.show();
    498 
    499       return false;
    500     }
    501 
    502     var width_pogress = parseFloat(progress.width());
    503     var width_parent = parseFloat(progress.parent().width());
    504     var width_old = Math.round(width_pogress * 100 / width_parent);
    505     if (caller === 'backup') {
    506       width = width_old + Math.round((width - width_old) / 2);
    507     }
    508 
    509     progress.css('width', width + '%');
    510     progress.text(width + '%');
    511     overlay.find('h3').text(param.title);
    512     overlay.find('.info').prepend(param.current_site + ' ' + param.text + '<br>');
    513     if (param.key === 'completed') {
    514       $('#backupsavvy-settings').find('.pupup .stop').text('Close');
    515       // progress.parent().hide();
    516       // overlay.hide();
    517       // progress.css('width', '1%');
    518       // progress.text('1%');
    519       // WPB_ITUP.status = '';
    520       return false;
    521     }
    522 
     851
     852    $(this).addClass('disable');
     853    BCSVVY.id = $(this).attr('data-id');
     854    BCSVVY.unique = $(this).attr('data-unique');
     855    BCSVVY.backup_download();
     856  });
     857
     858  $("body").on("submit", "form#ftp-site-settings", function (e) {
     859    e.preventDefault();
     860    BCSVVY.form = $(this).closest('form').serialize();
     861    BCSVVY.save_ftp_unique();
     862  });
     863
     864  // backup logs
     865  $('.logs form#log-list').on('click', '.submit-form', function (e) {
     866    e.preventDefault();
     867    // $(this).find('.form-submit').addClass('disable');
     868    BCSVVY.form = $('.logs form#log-list').serialize();
     869    // BCSVVY.form = $(this).html();
     870    BCSVVY.log_process();
    523871    return false;
    524   }
    525 
    526   // add new site
    527   $('#backupsavvy-settings').on('click', 'form#settings input[type="submit"]', click_add);
    528 
    529   $('#backupsavvy-settings:not(.single)').on('click', 'input[name="ftp_save"]', click_save_storage);
    530 
    531 
    532   $('#backupsavvy-settings').on('click', 'button#test-con', click_test_con);
    533 
    534   $('#backupsavvy-settings.single').on('click', 'button#make-default', click_set_default);
    535   $('#backupsavvy-settings.single').on('click', 'form input[type="submit"]', click_set_unique);
    536 
    537   // bulk operations
    538 
    539   // sync
    540   $('#backupsavvy-settings').on('click', '#bulk-op a.bulk-sync', click_sync);
    541 
    542   // all backups
    543   $('#backupsavvy-settings').on('click', '#bulk-op a.bulk-backup', click_backup);
    544 
    545   // create one backup/sync/remove
    546   $('table#sites-list').find('tr td.action').each(function () {
    547     $(this).on('click', 'a.backup.btn', click_backup_one);
    548     $(this).on('click', 'a.sync.btn', click_sync_one);
    549     $(this).on('click', 'a.remove.btn', click_remove_one);
    550   });
    551 
    552   $('#backupsavvy-settings').find('.overlay').on('click', '.stop', function () {
    553     window.location.reload();
    554   });
    555 
    556   // update to premium
    557   $('#backupsavvy-settings .t.premium').on('submit', 'form', function(e) {
    558     e.preventDefault();
    559     WPB_ITUP.api = $(this).find('#serial').val();
    560     WPB_ITUP.premium_update();
    561   })
    562 
    563   // click functions
    564   function click_save_storage(e) {
    565     e.stopPropagation();
    566     if (!$(this).hasClass('disable')) {
    567       disable_button(this);
    568       WPB_ITUP.form = $(this).closest('form').serialize();
    569       WPB_ITUP.save_storage();
    570     }
    571     return false;
    572   }
    573 
    574   function click_test_con(e) {
    575     e.stopPropagation();
    576     if (!$(this).hasClass('disable')) {
    577       disable_button(this);
    578       WPB_ITUP.form = $(this).closest('form').serialize();
    579       WPB_ITUP.test_con();
    580     }
    581     return false;
    582   }
    583 
    584   function click_add(e) {
    585     e.stopPropagation();
    586     if (!$(this).hasClass('disable')) {
    587       disable_button(this);
    588       WPB_ITUP.form = $(this).closest('form').serialize();
    589       WPB_ITUP.add_site();
    590     }
    591     return false;
    592   }
    593 
    594   function click_set_unique(e) {
    595     e.stopPropagation();
    596     if (!$(this).hasClass('disable')) {
    597       disable_button(this);
    598       WPB_ITUP.form = $(this).closest('form').serialize();
    599       WPB_ITUP.id = $(this).closest('form').find('input[name="unique_id"]').val();
    600       WPB_ITUP.set_unique();
    601     }
    602     return false;
    603   }
    604 
    605   function click_set_default(e) {
    606     e.stopPropagation();
    607     if (!$(this).hasClass('disable')) {
    608       disable_button(this);
    609       var form = $(this).closest('#backupsavvy-settings').find('form');
    610       WPB_ITUP.form = form.serialize();
    611       WPB_ITUP.id = form.find('input[name="unique_id"]').val();
    612       WPB_ITUP.set_default();
    613     }
    614     return false;
    615 
    616   }
    617 
    618   function click_sync(e) {
    619     e.stopPropagation();
    620     if (!$(this).hasClass('disable')) {
    621       disable_button(this);
    622       WPB_ITUP.step = 1;
    623       WPB_ITUP.active = '';
    624       WPB_ITUP.sync();
    625     }
    626     return false;
    627   }
    628 
    629   function click_sync_one(e) {
    630     e.stopPropagation();
    631     if (!$(this).hasClass('disable')) {
    632       disable_button(this);
    633       $(this).closest('td').find(".spinner").css('display', 'inline-block');
    634       WPB_ITUP.id = $(this).closest('td').find('div.hidden').attr('id');
    635       WPB_ITUP.sync_one();
    636     }
    637     return false;
    638   }
    639 
    640   function click_backup(e) {
    641     e.stopPropagation();
    642     if (!$(this).hasClass('disable')) {
    643       disable_button(this);
    644       WPB_ITUP.step = 1;
    645       WPB_ITUP.backup();
    646     }
    647     return false;
    648   }
    649 
    650   function click_backup_one(e) {
    651     e.stopPropagation();
    652     if (!$(this).hasClass('disable')) {
    653       disable_button(this);
    654       $(this).closest('td').find(".spinner").css('display', 'inline-block');
    655       WPB_ITUP.id = $(this).closest('td').find('div.hidden').attr('id');
    656       WPB_ITUP.backup_one();
    657     }
    658     return false;
    659   }
    660 
    661   function click_remove_one(e) {
    662     e.stopPropagation();
    663     if (!$(this).hasClass('disable')) {
    664       disable_button(this);
    665       $(this).closest('td').find(".spinner").css('display', 'inline-block');
    666       var id = $(this).closest('td').find('div.hidden').attr('id');
    667       WPB_ITUP.id = id;
    668       WPB_ITUP.remove_one();
    669     }
    670     return false;
    671   }
    672 
    673   function disable_button(button) {
    674     $(button).addClass('disable');
    675     $(button).off('click');
    676   }
    677 
    678   function enable_button(button, func_name) {
    679     $(button).removeClass('disable');
    680     $(button).on('click', func_name)
    681   }
     872  });
     873
    682874
    683875});
  • backupsavvy/trunk/assets/backupsavvy_style.css

    r2065940 r2236496  
    1 /*add scheduler job*/
    2 /*end add scheduler job*/
    3 ul.tabs {
    4   height: 36px;
    5   line-height: 25px;
    6   margin: 0 0 0px;
    7   list-style: none;
    8 }
    9 ul.tabs li {
    10   float: left;
    11   margin-right: 1px;
    12   border-radius: 5px 5px 0 0;
    13   -moz-border-radius: 5px 5px 0 0 !important;
    14   -webkit-border-radius: 5px 5px 0 0;
    15   -khtml-border-radius: 5px 5px 0 0;
    16   margin-bottom: 0;
     1.btn-light {
     2  color: #09f;
     3  border: #ddd 5px solid;
     4  background: #fff;
     5  cursor: pointer;
     6  display: inline-block;
     7  font-family: inherit;
     8  font-size: 20px;
     9  font-weight: 500;
     10  text-align: center;
     11  padding: 8px 20px;
     12  text-decoration: none;
     13  -webkit-box-shadow: none;
     14  -moz-box-shadow: none;
     15  box-shadow: none;
     16  text-shadow: none;
     17}
     18.btn-little {
     19  font-size: 14px;
     20  padding: 4px 7px;
     21  border-width: 2px;
     22}
     23.jBox-Confirm {
     24  z-index: 11000!important;
     25}
     26.ajax-loader {
     27  color: #fff;
     28  position: fixed;
     29  box-sizing: border-box;
     30  left: -9999px;
     31  top: -9999px;
     32  width: 0;
     33  height: 0;
     34  overflow: hidden;
     35  z-index: 999999;
     36}
     37.ajax-loader:after,
     38.ajax-loader:before {
     39  box-sizing: border-box;
     40  display: none;
     41}
     42.ajax-loader.is-active {
     43  background-color: rgba(0, 0, 0, 0.85);
     44  width: 100%;
     45  height: 100%;
     46  left: 0;
     47  top: 0;
     48}
     49.ajax-loader.is-active:after,
     50.ajax-loader.is-active:before {
     51  display: block;
     52}
     53.ajax-loader[data-text]:before {
     54  position: fixed;
     55  left: 0;
     56  top: 50%;
     57  color: currentColor;
     58  font-family: Helvetica, Arial, sans-serif;
     59  text-align: center;
     60  width: 100%;
     61  font-size: 14px;
     62}
     63.ajax-loader[data-text=""]:before {
     64  content: "Loading";
     65}
     66.ajax-loader[data-text]:not([data-text=""]):before {
     67  content: attr(data-text);
     68}
     69.ajax-loader[data-text][data-blink]:before {
     70  animation: blink 1s linear infinite alternate;
     71}
     72@keyframes rotation {
     73  0% {
     74    transform: rotate(0);
     75  }
     76  to {
     77    transform: rotate(359deg);
     78  }
     79}
     80@keyframes blink {
     81  0% {
     82    opacity: 0.5;
     83  }
     84  to {
     85    opacity: 1;
     86  }
     87}
     88.ajax-loader-default[data-text]:before {
     89  top: calc(50% - 63px);
     90}
     91.ajax-loader-default:after {
     92  content: "";
     93  position: fixed;
     94  width: 48px;
     95  height: 48px;
     96  border: 8px solid #fff;
     97  border-left-color: transparent;
     98  border-radius: 50%;
     99  top: calc(50% - 24px);
     100  left: calc(50% - 24px);
     101  animation: rotation 1s linear infinite;
     102}
     103.ajax-loader-default[data-half]:after {
     104  border-right-color: transparent;
     105}
     106.ajax-loader-default[data-inverse]:after {
     107  animation-direction: reverse;
     108}
     109.ajax-loader-default.min {
     110  position: absolute;
     111  color: white;
     112  background-color: rgba(250, 250, 250, 0.88);
     113}
     114.ajax-loader-default.min:after {
     115  position: absolute;
     116  border-width: 4px;
     117  top: 41%;
     118  border-color: #09f;
     119  border-left-color: transparent;
     120}
     121.ajax-loader-default.min:before {
     122  position: absolute;
     123  top: 12%;
     124  color: #09f;
     125  letter-spacing: 1px;
     126}
     127.ftp-form form {
     128  max-width: 306px;
     129  width: 100%;
     130}
     131.ftp-form form .field {
     132  float: left;
     133  width: 100%;
     134  margin-bottom: 7px;
     135}
     136.ftp-form form .field span {
     137  margin-bottom: 15px;
     138  display: block;
     139}
     140.ftp-form form .field label {
     141  float: left;
     142}
     143.ftp-form form .field input {
     144  float: right;
     145}
     146.ftp-form form .field input#host {
     147  width: 250px;
     148}
     149.ftp-form form .field input#port {
     150  width: 60px;
     151}
     152.ftp-form form .field > span label {
     153  float: none !important;
     154}
     155.ftp-form form .field > span input {
     156  float: none !important;
     157}
     158.ftp-form form .field input.btn {
     159  float: none !important;
     160}
     161.ftp-form form .field fieldset {
     162  width: 50%;
     163  border: 1px solid #b6b6b6;
     164  padding: 10px;
     165}
     166.ftp-form form .field fieldset label {
     167  float: none !important;
     168}
     169.ftp-form form .field fieldset input {
     170  float: none !important;
     171}
     172.ftp-form form .field.num {
     173  width: 58%;
     174}
     175.ftp-form form .field.num label {
     176  position: relative;
     177  top: 5px;
     178  font-weight: bold;
     179}
     180.ftp-form form .field.num input {
     181  width: 52px;
     182  text-align: center;
     183  padding: 2px;
     184}
     185.ftp-form .connected {
     186  margin-bottom: 15px;
     187}
     188.ftp-form .connected span {
     189  font-weight: bold;
     190  color: green;
     191}
     192.ftp-form .connected span.no {
     193  color: red;
     194}
     195#backupsavvy-settings table thead tr {
     196  background-color: #444;
     197  color: white;
     198}
     199#backupsavvy-settings table tbody td {
     200  background-color: white;
     201  padding: 8px 8px 8px 15px;
     202}
     203#backupsavvy-settings table span.sort {
     204  padding: 0 15px;
     205  cursor: pointer;
     206}
     207#backupsavvy-settings .preloader-one {
     208  display: none;
     209  position: fixed;
     210  top: 0;
     211  bottom: 0;
     212  left: 0;
     213  right: 0;
     214  opacity: 0.4;
     215  background: #000 url("preloader.gif") no-repeat center center;
     216  z-index: 1;
    17217}
    18218#backupsavvy-settings > .overlay {
     
    59259#backupsavvy-settings > .overlay .popup .stop:hover {
    60260  text-decoration: underline;
     261}
     262#backupsavvy-settings .tabs-v {
     263  float: left;
     264  border: 1px solid #ccc;
     265  background-color: #f1f1f1;
     266  width: 10%;
     267}
     268#backupsavvy-settings .tabs-v button {
     269  display: block;
     270  background-color: inherit;
     271  color: black;
     272  font-weight: bold;
     273  padding: 16px;
     274  width: 100%;
     275  border: none;
     276  outline: none;
     277  text-align: left;
     278  cursor: pointer;
     279  transition: 0.3s;
     280}
     281#backupsavvy-settings .tabs-v button:hover {
     282  background-color: #ddd;
     283}
     284#backupsavvy-settings .tabs-v button.active {
     285  background-color: #ccc;
     286}
     287#backupsavvy-settings .tabsv-content {
     288  margin-left: 15px;
     289  background: #ffffff;
     290  float: left;
     291  width: 85%;
     292  padding: 10px;
     293  border: 1px solid #c8c8c8;
     294}
     295#backupsavvy-settings .tabsv-content > div {
     296  display: none;
     297}
     298#backupsavvy-settings .tabsv-content > div:first-child {
     299  display: block;
     300}
     301#backupsavvy-settings ul.tabs {
     302  height: 36px;
     303  line-height: 25px;
     304  margin: 0 0 0px;
     305  list-style: none;
     306}
     307#backupsavvy-settings ul.tabs li {
     308  float: left;
     309  margin-right: 1px;
     310  border-radius: 5px 5px 0 0;
     311  -moz-border-radius: 5px 5px 0 0 !important;
     312  -webkit-border-radius: 5px 5px 0 0;
     313  -khtml-border-radius: 5px 5px 0 0;
     314  margin-bottom: 0;
    61315}
    62316#backupsavvy-settings ul.tabs li.tab-current a {
     
    69323  -khtml-border-radius: 5px 5px 0 0;
    70324  border: 1px solid #ccc;
    71   border-bottom: 1px solid #f1f1f1;
    72   margin-bottom: -1px;
     325  border-bottom: none;
     326  margin-bottom: -2px;
     327  bottom: -2px;
     328  -webkit-box-shadow: none;
     329  -moz-box-shadow: none;
     330  box-shadow: none;
    73331}
    74332#backupsavvy-settings ul.tabs li a {
    75   display: block;
    76333  padding: 5px 10px;
    77334  margin: 0 4px 0px 0;
    78   color: #111;
    79   font-size: 12pt;
    80   text-transform: uppercase;
     335  position: relative;
     336  background: #444;
     337  border: 1px solid rgba(0, 0, 0, 0.15);
     338  -webkit-border-radius: 2px;
     339  -moz-border-radius: 5px 5px 0 0;
     340  border-radius: 5px 5px 0 0;
     341  -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
     342  -moz-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
     343  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
     344  color: #FFF;
     345  cursor: pointer;
     346  display: inline-block;
     347  font-family: inherit;
     348  font-size: 20px;
     349  font-weight: 500;
     350  text-align: center;
     351  text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    81352  text-decoration: none;
    82   cursor: pointer;
    83   background: #afafaf;
    84   border: 1px solid #ccc;
    85   border-bottom: 0px solid #F9F9F9;
    86   position: relative;
    87   border-radius: 5px 5px 0 0;
    88   -moz-border-radius: 5px 5px 0 0 !important;
    89   -webkit-border-radius: 5px 5px 0 0;
    90   -khtml-border-radius: 5px 5px 0 0;
    91 }
    92 #backupsavvy-settings .btn.disable {
    93   background-color: #BABABA !important;
    94   cursor: default;
    95 }
    96 #backupsavvy-settings .spinner {
    97   visibility: visible;
    98   display: none;
    99 }
    100 #backupsavvy-settings form#settings .spinner {
    101   float: none;
    102   position: relative;
    103   top: 3px;
    104 }
    105 #backupsavvy-settings .description {
    106   font-size: 11px;
    107   color: gray;
    108 }
    109 #backupsavvy-settings .red {
    110   color: red;
    111 }
    112 #backupsavvy-settings .t6.update a {
    113   border: 2px solid #ef9a07;
    114   border-bottom: none;
    115   background-color: #e69200;
    116   color: white;
    117 }
    118 #backupsavvy-settings div.t {
     353}
     354#backupsavvy-settings div.t2 {
    119355  display: none;
    120356  float: left;
     
    127363  border: 1px solid #ccc;
    128364}
    129 #backupsavvy-settings .t1 form {
     365#backupsavvy-settings div.t2 #bulk-op {
     366  float: left;
     367  width: 99.7%;
     368  margin-bottom: 10px;
     369}
     370#backupsavvy-settings div.t2 #bulk-op .left {
     371  float: left;
     372}
     373#backupsavvy-settings div.t2 #bulk-op .right {
     374  float: right;
     375}
     376#backupsavvy-settings div.t2 #bulk-op select {
     377  height: auto;
     378  padding: 6px 24px 6px 7px;
     379  position: relative;
     380  top: -3px;
     381}
     382#backupsavvy-settings div.t2 #bulk-op input {
     383  padding: 4px 20px;
     384}
     385#backupsavvy-settings div.t1,
     386#backupsavvy-settings div.t3,
     387#backupsavvy-settings div.t4,
     388#backupsavvy-settings div.t5,
     389#backupsavvy-settings div.t6 {
     390  display: none;
     391  float: left;
     392  width: calc(100% - 60px);
     393  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
     394  -moz-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
     395  -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
     396  -khtml-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
     397  padding: 15px 20px;
     398  border: 1px solid #ccc;
     399}
     400#backupsavvy-settings div.t5 #existing-backups {
     401  width: 100%;
     402}
     403#backupsavvy-settings div.t5 #existing-backups table {
     404  width: 100%;
     405}
     406#backupsavvy-settings div.t5 #existing-backups td {
     407  background-color: #fff;
     408  padding-left: 15px;
     409  width: 23%;
     410  border: none;
     411}
     412#backupsavvy-settings div.t1 form {
    130413  max-width: 400px;
    131414}
    132 #backupsavvy-settings .t1 form .field {
     415#backupsavvy-settings div.t1 form .field {
    133416  float: left;
    134417  width: 100%;
    135418  margin-bottom: 5px;
    136419}
    137 #backupsavvy-settings .t1 form label {
     420#backupsavvy-settings div.t1 form label {
    138421  float: left;
    139422  font-weight: bold;
    140423}
    141 #backupsavvy-settings .t1 form input {
     424#backupsavvy-settings div.t1 form input {
    142425  float: right;
    143426  width: 65%;
    144427  padding: 4px;
    145428}
    146 #backupsavvy-settings .t1 form input[type="submit"] {
     429#backupsavvy-settings div.t1 form input[type="submit"] {
    147430  float: none;
    148431  width: auto;
    149432  padding: 8px 20px;
     433}
     434#backupsavvy-settings form#log-list select {
     435  padding: 0;
     436}
     437#backupsavvy-settings .btn.disable {
     438  background-color: #ddd !important;
     439  cursor: default;
     440  color: #ababab;
     441}
     442#backupsavvy-settings .spinner {
     443  visibility: visible;
     444  display: none;
     445}
     446#backupsavvy-settings form#settings .spinner {
     447  float: none;
     448  position: relative;
     449  top: 3px;
     450}
     451#backupsavvy-settings form#compare .row {
     452  width: 100%;
     453  float: left;
     454  clear: both;
     455  position: relative;
     456}
     457#backupsavvy-settings form#compare .col {
     458  float: left;
     459  position: relative;
     460}
     461#backupsavvy-settings form#compare .col-md-6 {
     462  width: 47%;
     463}
     464#backupsavvy-settings form#compare textarea {
     465  width: 100%;
     466}
     467#backupsavvy-settings .mt-1 {
     468  margin-top: 10px;
     469}
     470#backupsavvy-settings .mt-2 {
     471  margin-top: 20px;
     472}
     473#backupsavvy-settings .mr-1 {
     474  margin-right: 10px;
     475}
     476#backupsavvy-settings .description {
     477  font-size: 11px;
     478  color: gray;
     479}
     480#backupsavvy-settings .red {
     481  color: red;
    150482}
    151483#backupsavvy-settings .btn {
     
    172504  font-size: 14px;
    173505  padding: 4px 7px;
    174 }
    175 #backupsavvy-settings .premium ol {
    176   list-style: none;
    177   counter-reset: item;
    178   margin-left: 1em;
    179   margin-right: 1em;
    180 }
    181 #backupsavvy-settings .premium li {
    182   counter-increment: item;
    183   margin-bottom: 5px;
    184 }
    185 #backupsavvy-settings .premium li:before {
    186   margin-right: 10px;
    187   content: counter(item);
    188   background: lightblue;
    189   border-radius: 100%;
    190   color: white;
    191   width: 1.8em;
    192   height: 1.5em;
    193   text-align: center;
    194   display: inline-block;
    195   font-weight: bold;
    196   padding-top: 3px;
    197 }
    198 #backupsavvy-settings .premium section {
    199   float: left;
    200   padding: 10px 0;
    201 }
    202 #backupsavvy-settings .premium section.info-block {
    203   float: right;
    204   padding: 5px 5px 5px 0;
    205   background-color: white;
    206   border: 2px solid #e69200;
    207   position: relative;
    208   top: -45px;
    209 }
    210 #backupsavvy-settings .premium section form {
    211   max-width: 300px;
    212 }
    213 #backupsavvy-settings .premium section form label {
    214   font-weight: bold;
    215 }
    216 #backupsavvy-settings .premium section form label input {
    217   width: 200px;
    218   margin-left: 10px;
    219 }
    220 #backupsavvy-settings .premium section form label + input.btn {
    221   position: relative;
    222   left: 27px;
    223   margin: 10px auto 0;
    224   display: block;
    225   width: auto;
    226 }
    227 #backupsavvy-settings .premium .btn {
    228   width: 44px;
    229   display: block;
    230   margin: 0 auto;
    231 }
    232 #add-new-job {
     506  border-width: 2px;
     507}
     508#backupsavvy-settings #add-new-job {
    233509  width: 60%;
    234510}
    235 #add-new-job .title {
     511#backupsavvy-settings #add-new-job .title {
    236512  width: 100%;
    237513  background-color: #98989833;
     
    241517  border-radius: 5px 5px 0 0;
    242518}
    243 #add-new-job form {
     519#backupsavvy-settings #add-new-job form {
    244520  display: none;
    245521}
    246 .form-style-1 {
     522#backupsavvy-settings .form-style-1 {
    247523  margin: 0;
    248524  max-width: 520px;
     
    250526  font: 13px "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    251527}
    252 .form-style-1 li {
     528#backupsavvy-settings .form-style-1 li {
    253529  padding: 0;
    254530  display: block;
     
    256532  margin: 10px 0 0 0;
    257533}
    258 .form-style-1 li > span.task-name {
     534#backupsavvy-settings .form-style-1 li > span.task-name {
    259535  display: inline-block;
    260536  width: 44%;
    261537}
    262 .form-style-1 li > span.time {
     538#backupsavvy-settings .form-style-1 li > span.time {
    263539  display: inline-block;
    264540  width: 40%;
    265541}
    266 .form-style-1 label {
     542#backupsavvy-settings .form-style-1 label {
    267543  margin: 0 0 3px 0;
    268544  padding: 0px;
     
    270546  font-weight: bold;
    271547}
    272 .form-style-1 input[type=text] {
     548#backupsavvy-settings .form-style-1 input[type=text] {
    273549  box-sizing: border-box;
    274550  -webkit-box-sizing: border-box;
     
    283559  outline: none;
    284560}
    285 .form-style-1 input[type=text]:focus {
     561#backupsavvy-settings .form-style-1 input[type=text]:focus {
    286562  -moz-box-shadow: 0 0 8px #88D5E9;
    287563  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    289565  border: 1px solid #88D5E9;
    290566}
    291 .form-style-1 input[type=date] {
     567#backupsavvy-settings .form-style-1 input[type=date] {
    292568  box-sizing: border-box;
    293569  -webkit-box-sizing: border-box;
     
    302578  outline: none;
    303579}
    304 .form-style-1 input[type=date]:focus {
     580#backupsavvy-settings .form-style-1 input[type=date]:focus {
    305581  -moz-box-shadow: 0 0 8px #88D5E9;
    306582  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    308584  border: 1px solid #88D5E9;
    309585}
    310 .form-style-1 input[type=datetime] {
     586#backupsavvy-settings .form-style-1 input[type=datetime] {
    311587  box-sizing: border-box;
    312588  -webkit-box-sizing: border-box;
     
    321597  outline: none;
    322598}
    323 .form-style-1 input[type=datetime]:focus {
     599#backupsavvy-settings .form-style-1 input[type=datetime]:focus {
    324600  -moz-box-shadow: 0 0 8px #88D5E9;
    325601  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    327603  border: 1px solid #88D5E9;
    328604}
    329 .form-style-1 input[type=number] {
     605#backupsavvy-settings .form-style-1 input[type=number] {
    330606  box-sizing: border-box;
    331607  -webkit-box-sizing: border-box;
     
    340616  outline: none;
    341617}
    342 .form-style-1 input[type=number]:focus {
     618#backupsavvy-settings .form-style-1 input[type=number]:focus {
    343619  -moz-box-shadow: 0 0 8px #88D5E9;
    344620  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    346622  border: 1px solid #88D5E9;
    347623}
    348 .form-style-1 input[type=search] {
     624#backupsavvy-settings .form-style-1 input[type=search] {
    349625  box-sizing: border-box;
    350626  -webkit-box-sizing: border-box;
     
    359635  outline: none;
    360636}
    361 .form-style-1 input[type=search]:focus {
     637#backupsavvy-settings .form-style-1 input[type=search]:focus {
    362638  -moz-box-shadow: 0 0 8px #88D5E9;
    363639  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    365641  border: 1px solid #88D5E9;
    366642}
    367 .form-style-1 input[type=time] {
     643#backupsavvy-settings .form-style-1 input[type=time] {
    368644  box-sizing: border-box;
    369645  -webkit-box-sizing: border-box;
     
    378654  outline: none;
    379655}
    380 .form-style-1 input[type=time]:focus {
     656#backupsavvy-settings .form-style-1 input[type=time]:focus {
    381657  -moz-box-shadow: 0 0 8px #88D5E9;
    382658  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    384660  border: 1px solid #88D5E9;
    385661}
    386 .form-style-1 input[type=url] {
     662#backupsavvy-settings .form-style-1 input[type=url] {
    387663  box-sizing: border-box;
    388664  -webkit-box-sizing: border-box;
     
    397673  outline: none;
    398674}
    399 .form-style-1 input[type=url]:focus {
     675#backupsavvy-settings .form-style-1 input[type=url]:focus {
    400676  -moz-box-shadow: 0 0 8px #88D5E9;
    401677  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    403679  border: 1px solid #88D5E9;
    404680}
    405 .form-style-1 input[type=email] {
     681#backupsavvy-settings .form-style-1 input[type=email] {
    406682  box-sizing: border-box;
    407683  -webkit-box-sizing: border-box;
     
    416692  outline: none;
    417693}
    418 .form-style-1 input[type=email]:focus {
     694#backupsavvy-settings .form-style-1 input[type=email]:focus {
    419695  -moz-box-shadow: 0 0 8px #88D5E9;
    420696  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    422698  border: 1px solid #88D5E9;
    423699}
    424 .form-style-1 textarea:focus {
     700#backupsavvy-settings .form-style-1 textarea:focus {
    425701  -moz-box-shadow: 0 0 8px #88D5E9;
    426702  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    428704  border: 1px solid #88D5E9;
    429705}
    430 .form-style-1 select:focus {
     706#backupsavvy-settings .form-style-1 select:focus {
    431707  -moz-box-shadow: 0 0 8px #88D5E9;
    432708  -webkit-box-shadow: 0 0 8px #88D5E9;
     
    434710  border: 1px solid #88D5E9;
    435711}
    436 .form-style-1 .field-divided {
     712#backupsavvy-settings .form-style-1 .field-divided {
    437713  width: 49%;
    438714}
    439 .form-style-1 .field-long {
    440   width: 100%;
    441 }
    442 .form-style-1 .field-select {
    443   width: 100%;
    444 }
    445 .form-style-1 .field-textarea {
     715#backupsavvy-settings .form-style-1 .field-long {
     716  width: 100%;
     717}
     718#backupsavvy-settings .form-style-1 .field-select {
     719  width: 100%;
     720  padding: 0;
     721}
     722#backupsavvy-settings .form-style-1 .field-textarea {
    446723  height: 100px;
    447724}
    448 .form-style-1 input[type=submit] {
     725#backupsavvy-settings .form-style-1 input[type=button] {
    449726  background: #3E61C6;
    450727  border: 1px solid rgba(0, 0, 0, 0.15);
     
    466743  text-decoration: none;
    467744}
    468 .form-style-1 input[type=submit]:hover {
     745#backupsavvy-settings .form-style-1 input[type=button]:hover {
    469746  background: #4691A4;
    470747  box-shadow: none;
     
    472749  -webkit-box-shadow: none;
    473750}
    474 .form-style-1 input[type=button] {
    475   background: #3E61C6;
    476   border: 1px solid rgba(0, 0, 0, 0.15);
    477   -webkit-border-radius: 2px;
    478   -moz-border-radius: 2px;
    479   border-radius: 2px;
    480   -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    481   -moz-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    482   box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    483   color: #FFF;
    484   cursor: pointer;
    485   display: inline-block;
    486   font-family: inherit;
    487   font-size: 17px;
    488   font-weight: 500;
    489   text-align: center;
    490   padding: 3px 15px;
    491   text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    492   text-decoration: none;
    493 }
    494 .form-style-1 input[type=button]:hover {
    495   background: #4691A4;
    496   box-shadow: none;
    497   -moz-box-shadow: none;
    498   -webkit-box-shadow: none;
    499 }
    500 .form-style-1 .required {
     751#backupsavvy-settings .form-style-1 .required {
    501752  color: red;
    502753}
    503 textarea {
     754#backupsavvy-settings textarea {
    504755  box-sizing: border-box;
    505756  -webkit-box-sizing: border-box;
     
    514765  outline: none;
    515766}
    516 select {
     767#backupsavvy-settings select {
    517768  box-sizing: border-box;
    518769  -webkit-box-sizing: border-box;
     
    526777  -o-transition: all 0.3s ease-in-out;
    527778  outline: none;
    528 }
    529 table#scheduller-jobs {
     779} 
     780#backupsavvy-settings table#scheduller-jobs {
    530781  width: 100%;
    531782  margin-top: 10px;
    532783}
    533 table#scheduller-jobs thead tr {
    534   background-color: #afafaf;
    535 }
    536 table#scheduller-jobs tbody td {
    537   background-color: ghostwhite;
    538   padding-left: 15px;
     784#backupsavvy-settings .container.sites-list table.top-options,
     785#backupsavvy-settings .container.existing-list table.top-options {
     786  width: 100%;
     787  position: relative;
     788}
     789#backupsavvy-settings .container.sites-list table.top-options td.first,
     790#backupsavvy-settings .container.existing-list table.top-options td.first {
     791  padding-left: 28px;
     792}
     793#backupsavvy-settings .container.sites-list table.top-options .spinner,
     794#backupsavvy-settings .container.existing-list table.top-options .spinner {
     795  display: block;
     796  float: left;
     797  position: absolute;
     798  left: -3px;
     799  top: 22px;
     800}
     801#backupsavvy-settings .container.sites-list table.top-options td.per-page,
     802#backupsavvy-settings .container.existing-list table.top-options td.per-page {
     803  font-weight: bold;
     804}
     805#backupsavvy-settings .container.sites-list table.top-options td.per-page span:not(.per-page),
     806#backupsavvy-settings .container.existing-list table.top-options td.per-page span:not(.per-page) {
     807  color: #1d94cf;
     808}
     809#backupsavvy-settings .container.sites-list table.top-options td.per-page span:not(.per-page):hover:not(.current),
     810#backupsavvy-settings .container.existing-list table.top-options td.per-page span:not(.per-page):hover:not(.current) {
     811  cursor: pointer;
     812  text-decoration: underline;
     813}
     814#backupsavvy-settings .container.sites-list table.top-options td.per-page span:not(.per-page).current,
     815#backupsavvy-settings .container.existing-list table.top-options td.per-page span:not(.per-page).current {
     816  color: inherit;
     817}
     818#backupsavvy-settings .container.existing-list table.top-options {
     819  border-collapse: collapse;
     820}
     821#backupsavvy-settings .container.existing-list table.top-options .spinner {
     822  top: 11px;
     823  left: -5px;
     824}
     825#backupsavvy-settings .container.existing-list table.top-options td.first {
     826  padding: 0;
     827  width: 31px;
     828}
     829#backupsavvy-settings .container.existing-list table.top-options td.per-page {
     830  width: 60%;
     831  padding-left: 0;
     832}
     833#backupsavvy-settings .container.existing-list table.top-options td.per-page + td {
     834  text-align: right;
     835}
     836#backupsavvy-settings table#sites-list {
     837  width: 100%;
     838  margin-top: 10px;
     839}
     840#backupsavvy-settings table#sites-list tbody td.links img {
     841  height: 20px;
     842  position: relative;
     843  top: 4px;
     844}
     845#backupsavvy-settings table#sites-list tbody td.action {
    539846  width: 23%;
    540847}
    541 table#sites-list {
    542   width: 100%;
    543   margin-top: 10px;
    544 }
    545 table#sites-list thead tr {
    546   background-color: #afafaf;
    547 }
    548 table#sites-list tbody td {
    549   background-color: ghostwhite;
    550   padding-left: 15px;
    551 }
    552 table#sites-list tbody td.action {
    553   width: 23%;
    554 }
    555 table#sites-list div.hidden {
     848#backupsavvy-settings table#sites-list div.hidden {
    556849  display: none;
    557850}
    558 table#backups-settings thead tr {
    559   background-color: #afafaf;
    560 }
    561 table#backups-settings tbody td {
    562   background-color: ghostwhite;
    563   padding-left: 15px;
    564 }
    565 .progressbar {
     851#backupsavvy-settings .progressbar {
    566852  margin-top: 20px;
    567853  margin-bottom: 10px;
     
    573859  display: none;
    574860}
    575 .progressbar #progresssteps {
     861#backupsavvy-settings .progressbar #progresssteps {
    576862  background: #7db9e8;
    577863  background: -moz-linear-gradient(top, #7db9e8 0%, #7db9e8 5%, #207cca 55%, #2989d8 100%);
     
    586872  animation: progress-bar-stripes 2s linear infinite;
    587873}
    588 .progressbar .bwpu-progress {
     874#backupsavvy-settings .progressbar .bwpu-progress {
    589875  background-color: #1d94cf;
    590876  color: #fff;
     
    592878  text-align: center;
    593879}
    594 #bulk-op a.btn {
    595   background: #3E61C6;
    596   border: 1px solid rgba(0, 0, 0, 0.15);
    597   -webkit-border-radius: 2px;
    598   -moz-border-radius: 2px;
    599   border-radius: 2px;
    600   -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    601   -moz-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    602   box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    603   color: #FFF;
     880#backupsavvy-settings a {
     881  color: #09f;
     882}
     883#backupsavvy-settings a.btn,
     884#backupsavvy-settings .btn {
     885  color: #09f;
     886  border: #ddd 5px solid;
     887  background: #fff;
    604888  cursor: pointer;
    605889  display: inline-block;
     
    609893  text-align: center;
    610894  padding: 8px 20px;
    611   text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    612895  text-decoration: none;
    613 }
    614 #sites-list a.btn {
    615   background: #3E61C6;
    616   border: 1px solid rgba(0, 0, 0, 0.15);
    617   -webkit-border-radius: 2px;
    618   -moz-border-radius: 2px;
    619   border-radius: 2px;
    620   -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    621   -moz-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    622   box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    623   color: #FFF;
     896  -webkit-box-shadow: none;
     897  -moz-box-shadow: none;
     898  box-shadow: none;
     899  text-shadow: none;
     900}
     901#backupsavvy-settings .storage-settings form {
     902  max-width: 306px;
     903  width: 100%;
     904}
     905#backupsavvy-settings .storage-settings form .field {
     906  float: left;
     907  width: 100%;
     908  margin-bottom: 7px;
     909}
     910#backupsavvy-settings .storage-settings form .field span {
     911  margin-bottom: 15px;
     912  display: block;
     913}
     914#backupsavvy-settings .storage-settings form .field label {
     915  float: left;
     916}
     917#backupsavvy-settings .storage-settings form .field input {
     918  float: right;
     919}
     920#backupsavvy-settings .storage-settings form .field input#host {
     921  width: 250px;
     922}
     923#backupsavvy-settings .storage-settings form .field input#port {
     924  width: 60px;
     925}
     926#backupsavvy-settings .storage-settings form .field > span label {
     927  float: none !important;
     928}
     929#backupsavvy-settings .storage-settings form .field > span input {
     930  float: none !important;
     931}
     932#backupsavvy-settings .storage-settings form .field input.btn {
     933  float: none !important;
     934}
     935#backupsavvy-settings .storage-settings form .field fieldset {
     936  width: 50%;
     937  border: 1px solid #b6b6b6;
     938  padding: 10px;
     939}
     940#backupsavvy-settings .storage-settings form .field fieldset label {
     941  float: none !important;
     942}
     943#backupsavvy-settings .storage-settings form .field fieldset input {
     944  float: none !important;
     945}
     946#backupsavvy-settings .storage-settings form .field.num {
     947  width: 58%;
     948}
     949#backupsavvy-settings .storage-settings form .field.num label {
     950  position: relative;
     951  top: 5px;
     952  font-weight: bold;
     953}
     954#backupsavvy-settings .storage-settings form .field.num input {
     955  width: 52px;
     956  text-align: center;
     957  padding: 2px;
     958}
     959#backupsavvy-settings .storage-settings .connected {
     960  margin-bottom: 15px;
     961}
     962#backupsavvy-settings .storage-settings .connected span {
     963  font-weight: bold;
     964  color: green;
     965}
     966#backupsavvy-settings .storage-settings .connected span.no {
     967  color: red;
     968}
     969.ftp-inner-box form {
     970  max-width: 306px;
     971  width: 100%;
     972}
     973.ftp-inner-box form .field {
     974  float: left;
     975  width: 100%;
     976  margin-bottom: 7px;
     977}
     978.ftp-inner-box form .field span {
     979  margin-bottom: 15px;
     980  display: block;
     981}
     982.ftp-inner-box form .field label {
     983  float: left;
     984}
     985.ftp-inner-box form .field input {
     986  float: right;
     987}
     988.ftp-inner-box form .field input#host {
     989  width: 250px;
     990}
     991.ftp-inner-box form .field input#port {
     992  width: 60px;
     993}
     994.ftp-inner-box form .field > span label {
     995  float: none !important;
     996}
     997.ftp-inner-box form .field > span input {
     998  float: none !important;
     999}
     1000.ftp-inner-box form .field input.btn {
     1001  float: none !important;
     1002}
     1003.ftp-inner-box form .field fieldset {
     1004  width: 50%;
     1005  border: 1px solid #b6b6b6;
     1006  padding: 10px;
     1007}
     1008.ftp-inner-box form .field fieldset label {
     1009  float: none !important;
     1010}
     1011.ftp-inner-box form .field fieldset input {
     1012  float: none !important;
     1013}
     1014.ftp-inner-box form .field.num {
     1015  width: 58%;
     1016}
     1017.ftp-inner-box form .field.num label {
     1018  position: relative;
     1019  top: 5px;
     1020  font-weight: bold;
     1021}
     1022.ftp-inner-box form .field.num input {
     1023  width: 52px;
     1024  text-align: center;
     1025  padding: 2px;
     1026}
     1027.ftp-inner-box .connected {
     1028  margin-bottom: 15px;
     1029}
     1030.ftp-inner-box .connected span {
     1031  font-weight: bold;
     1032  color: green;
     1033}
     1034.ftp-inner-box .connected span.no {
     1035  color: red;
     1036}
     1037.ftp-inner-box form {
     1038  padding-top: 20px;
     1039  margin: 0 auto;
     1040}
     1041.ftp-inner-box form .field span label {
     1042  float: left !important;
     1043}
     1044.ftp-inner-box form .field span input {
     1045  float: right !important;
     1046}
     1047.ftp-inner-box form .field fieldset {
     1048  width: calc(100% - 20px) !important;
     1049  border-color: #ddd;
     1050}
     1051.ftp-inner-box form #return-restore {
     1052  border: none;
     1053  color: red;
     1054  float: right;
     1055}
     1056#restore-admin-panel {
     1057  display: none;
     1058}
     1059#restore-admin-panel-inner {
     1060  margin-top: 22px;
     1061}
     1062#restore-admin-panel-inner a {
     1063  margin: 10px;
     1064}
     1065#restore-admin-panel-inner .btn {
     1066  color: #09f;
     1067  border: #ddd 5px solid;
     1068  background: #fff;
    6241069  cursor: pointer;
    6251070  display: inline-block;
     
    6291074  text-align: center;
    6301075  padding: 8px 20px;
    631   text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    6321076  text-decoration: none;
    633   font-size: 14px;
    634   padding: 4px 7px;
    635 }
    636 .storage-settings form {
    637   max-width: 400px;
    638   width: 100%;
    639 }
    640 .storage-settings form .btn {
    641   background: #3E61C6;
    642   border: 1px solid rgba(0, 0, 0, 0.15);
    643   -webkit-border-radius: 2px;
    644   -moz-border-radius: 2px;
    645   border-radius: 2px;
    646   -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    647   -moz-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    648   box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    649   color: #FFF;
    650   cursor: pointer;
    651   display: inline-block;
    652   font-family: inherit;
    653   font-size: 20px;
    654   font-weight: 500;
    655   text-align: center;
    656   padding: 8px 20px;
    657   text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    658   text-decoration: none;
    659   font-size: 14px;
    660   padding: 4px 7px;
    661 }
    662 .storage-settings form .field {
    663   float: left;
    664   width: 100%;
    665   margin-bottom: 7px;
    666 }
    667 .storage-settings form .field label {
    668   float: left;
    669 }
    670 .storage-settings form .field input {
    671   float: right;
    672 }
    673 .storage-settings form .field > span label {
    674   float: none !important;
    675 }
    676 .storage-settings form .field > span input {
    677   float: none !important;
    678 }
    679 .storage-settings form .field input.btn {
    680   float: none !important;
    681 }
    682 .storage-settings form .field fieldset {
    683   width: 50%;
    684   border: 1px solid #b6b6b6;
    685   padding: 10px;
    686 }
    687 .storage-settings form .field fieldset label {
    688   float: none !important;
    689 }
    690 .storage-settings form .field fieldset input {
    691   float: none !important;
    692 }
    693 .storage-settings form .field.num {
    694   width: 50%;
    695 }
    696 .storage-settings form .field.num label {
    697   position: relative;
    698   top: 5px;
    699   font-weight: bold;
    700 }
    701 .storage-settings form .field.num input {
    702   width: 52px;
    703   text-align: center;
    704   padding: 2px;
    705 }
    706 .storage-settings .connected span {
    707   font-weight: bold;
    708   color: green;
    709 }
    710 .storage-settings .connected span.no {
    711   color: red;
    712 }
    713 @media all and (max-width: 900px) {
    714   #backupsavvy-settings .premium section {
    715     float: none;
    716     margin-bottom: 10px;
    717   }
    718   #backupsavvy-settings .premium section.info-block {
    719     top: 0;
    720     float: none;
    721   }
     1077  -webkit-box-shadow: none;
     1078  -moz-box-shadow: none;
     1079  box-shadow: none;
     1080  text-shadow: none;
    7221081}
    7231082/*# sourceMappingURL=backupsavvy_style.css.map */
  • backupsavvy/trunk/assets/backupsavvy_style.css.map

    r2127911 r2236496  
    1 {"version":3,"sources":["backupsavvy_style.less"],"names":[],"mappings":";;AAEA,EAAE;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;;AAJF,EAAE,KAKA;EACE,WAAA;EACA,iBAAA;EACA,0BAAA;EACA,0CAAA;EACA,kCAAA;EACA,iCAAA;EACA,gBAAA;;AAGJ,qBACE;EACE,eAAA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;EACA,oCAAA;EACA,UAAA;;AAXJ,qBACE,WAWE;E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WAAA;EACA,WAAA;EACA,kBAAA;;AA7BN,iBACE,KAyBE,OAIE;EACE,WAAA;;AA/BR,iBACE,KAyBE,OAOE;EACE,YAAA;;AAlCR,iBACE,KAyBE,OAUE,OACE;EACE,sBAAA;;AAtCV,iBACE,KAyBE,OAUE,OAIE;EACE,sBAAA;;AAzCV,iBACE,KAyBE,OAkBE,MAAK;EACH,sBAAA;;AA7CR,iBACE,KAyBE,OAqBE;EAOE,UAAA;EACA,yBAAA;EACA,aAAA;;AAxDR,iBACE,KAyBE,OAqBE,SACE;EACE,sBAAA;;AAjDV,iBACE,KAyBE,OAqBE,SAIE;EACE,sBAAA;;AApDV,iBACE,KA0DE,OAAM;EACJ,UAAA;;AA5DN,iBACE,KA0DE,OAAM,IAEJ;EACE,kBAAA;EACA,QAAA;EACA,iBAAA;;AAhER,iBACE,KA0DE,OAAM,IAOJ;EACE,WAAA;EACA,kBAAA;EACA,YAAA;;AArER,iBAyEE,WACE;EACE,iBAAA;EACA,YAAA;;AA5EN,iBAyEE,WAKE,KAAI;EACF,UAAA;;AAKN,gBAAkC;EAChC,qBACE,SACE;IACE,WAAA;IACA,mBAAA;;EACA,qBAJJ,SACE,QAGG;IACC,MAAA;IACA,WAAA","file":"backupsavvy_style.css"}
     1{"version":3,"sources":["backupsavvy_style.less"],"names":[],"mappings":"AAeA;EACE,WAAA;EACA,sBAAA;EACA,gBAAA;EACA,eAAA;EACA,qBAAA;EACA,oBAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,iBAAA;EACA,qBAAA;EACA,wBAAA;EACA,qBAAA;EACA,gBAAA;EACA,iBAAA;;AAEF;EACE,eAAA;EACA,gBAAA;EACA,iBAAA;;AAEF;EACE,wBAAA;;AAEF;EACE,WAAA;EACA,eAAA;EACA,sBAAA;EACA,aAAA;EACA,YAAA;EACA,QAAA;EACA,SAAA;EACA,gBAAA;EACA,eAAA;;AACA,YAAC;AAAQ,YAAC;EACR,sBAAA;EACA,aAAA;;AAEF,YAA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EACA,oBAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,iBAAA;EACA,qBAAA;EACA,wBAAA;EACA,qBAAA;EACA,gBAAA;EACA,iBAAA","file":"backupsavvy_style.css"}
  • backupsavvy/trunk/assets/backupsavvy_style.less

    r2127911 r2236496  
    1 /*add scheduler job*/
    2 /*end add scheduler job*/
    3 ul.tabs {
    4   height: 36px;
    5   line-height: 25px;
    6   margin: 0 0 0px;
    7   list-style: none;
    8   li {
    9     float: left;
    10     margin-right: 1px;
    11     border-radius: 5px 5px 0 0;
    12     -moz-border-radius: 5px 5px 0 0 !important;
    13     -webkit-border-radius: 5px 5px 0 0;
    14     -khtml-border-radius: 5px 5px 0 0;
    15     margin-bottom: 0;
    16   }
    17 }
     1@color_1: #444;
     2@color_2: #111;
     3@color_3: gray;
     4@color_4: red;
     5@color_5: #FFF;
     6@color_6: #fff;
     7@color_7: green;
     8@font_family_1: inherit;
     9@background_color_1: rgba(0,0,0,0.5);
     10@background_color_2: white;
     11@background_color_3: #BABABA;
     12@background_color_4: #98989833;
     13@background_color_5: #afafaf;
     14@background_color_6: ghostwhite;
     15@background_color_7: #1d94cf;
     16.btn-light {
     17  color: #09f;
     18  border: #ddd 5px solid;
     19  background: #fff;
     20  cursor: pointer;
     21  display: inline-block;
     22  font-family: @font_family_1;
     23  font-size: 20px;
     24  font-weight: 500;
     25  text-align: center;
     26  padding: 8px 20px;
     27  text-decoration: none;
     28  -webkit-box-shadow: none;
     29  -moz-box-shadow: none;
     30  box-shadow: none;
     31  text-shadow: none;
     32}
     33.btn-little {
     34  font-size: 14px;
     35  padding: 4px 7px;
     36  border-width: 2px;
     37}
     38.jBox-Confirm {
     39  z-index: 11000!important;
     40}
     41.ajax-loader {
     42  color: #fff;
     43  position: fixed;
     44  box-sizing: border-box;
     45  left: -9999px;
     46  top: -9999px;
     47  width: 0;
     48  height: 0;
     49  overflow: hidden;
     50  z-index: 999999;
     51  &:after, &:before {
     52    box-sizing: border-box;
     53    display: none
     54  };
     55  &.is-active {
     56    background-color: rgba(0, 0, 0, .85);
     57    width: 100%;
     58    height: 100%;
     59    left: 0;
     60    top: 0;
     61    &:after, &:before {
     62      display: block
     63    }
     64  };
     65  &[data-text]:before {
     66    position: fixed;
     67    left: 0;
     68    top: 50%;
     69    color: currentColor;
     70    font-family: Helvetica, Arial, sans-serif;
     71    text-align: center;
     72    width: 100%;
     73    font-size: 14px
     74  };
     75
     76  &[data-text=""]:before {
     77    content: "Loading"
     78  };
     79  &[data-text]:not([data-text=""]):before {
     80    content: attr(data-text)
     81  };
     82  &[data-text][data-blink]:before {
     83    animation: blink 1s linear infinite alternate
     84  }
     85
     86}
     87
     88@keyframes rotation {
     89  0% {
     90    transform: rotate(0)
     91  }
     92  to {
     93    transform: rotate(359deg)
     94  }
     95}
     96
     97@keyframes blink {
     98  0% {
     99    opacity: .5
     100  }
     101  to {
     102    opacity: 1
     103  }
     104}
     105
     106.ajax-loader-default {
     107  &[data-text]:before {
     108    top: calc(50% - 63px)
     109  };
     110  &:after {
     111    content: "";
     112    position: fixed;
     113    width: 48px;
     114    height: 48px;
     115    border: 8px solid #fff;
     116    border-left-color: transparent;
     117    border-radius: 50%;
     118    top: calc(50% - 24px);
     119    left: calc(50% - 24px);
     120    animation: rotation 1s linear infinite
     121  };
     122  &[data-half]:after {
     123    border-right-color: transparent
     124  };
     125  &[data-inverse]:after {
     126    animation-direction: reverse
     127  };
     128  &.min {
     129    position: absolute;
     130    color: white;
     131    background-color: rgba(250, 250, 250, 0.88);
     132    &:after {
     133      position: absolute;
     134      border-width: 4px;
     135      top: 41%;
     136      border-color: #09f;
     137      border-left-color: transparent;
     138    };
     139    &:before {
     140      position: absolute;
     141      top: 12%;
     142      color: #09f;
     143      letter-spacing: 1px;
     144    }
     145  }
     146}
     147
     148.ftp-form {
     149  form {
     150    max-width: 306px;
     151    width: 100%;
     152    .field {
     153      float: left;
     154      width: 100%;
     155      margin-bottom: 7px;
     156      span {
     157        margin-bottom: 15px;
     158        display: block;
     159      }
     160      label {
     161        float: left;
     162      }
     163      input {
     164        float: right;
     165        &#host {
     166          width: 250px;
     167        }
     168        &#port {
     169          width: 60px;
     170        }
     171      }
     172      >span {
     173        label {
     174          float: none !important;
     175        }
     176        input {
     177          float: none !important;
     178        }
     179      }
     180      input.btn {
     181        float: none !important;
     182      }
     183      fieldset {
     184        label {
     185          float: none !important;
     186        }
     187        input {
     188          float: none !important;
     189        }
     190        width: 50%;
     191        border: 1px solid #b6b6b6;
     192        padding: 10px;
     193      }
     194    }
     195    .field.num {
     196      width: 58%;
     197      label {
     198        position: relative;
     199        top: 5px;
     200        font-weight: bold;
     201      }
     202      input {
     203        width: 52px;
     204        text-align: center;
     205        padding: 2px;
     206      }
     207    }
     208  }
     209  .connected {
     210    margin-bottom: 15px;
     211    span {
     212      font-weight: bold;
     213      color: @color_7;
     214    }
     215    span.no {
     216      color: @color_4;
     217    }
     218  }
     219}
     220
     221
    18222#backupsavvy-settings {
     223  table {
     224    thead tr {
     225      background-color: #444;
     226      color: white;
     227    }
     228    tbody {
     229      td {
     230        background-color: white;
     231        padding:8px 8px 8px 15px;
     232      }
     233    }
     234    span.sort {
     235      padding: 0 15px;
     236      cursor: pointer;
     237    }
     238  }
     239  .preloader-one {
     240    display: none;
     241    position: fixed;
     242    top: 0;
     243    bottom: 0;
     244    left: 0;
     245    right: 0;
     246    opacity: 0.4;
     247    background: #000 url("preloader.gif") no-repeat center center;
     248    z-index: 1;
     249  }
    19250  >.overlay {
    20251    position: fixed;
     
    26257    right: 0;
    27258    bottom: 0;
    28     background-color: rgba(0,0,0,0.5);
     259    background-color: @background_color_1;
    29260    z-index: 2;
    30261    .popup {
     
    33264      left: 50%;
    34265      min-height: 100px;
    35       background-color: white;
     266      background-color: @background_color_2;
    36267      top: 20%;
    37268      margin-left: -35%;
     
    61292    }
    62293  }
     294  .tabs-v {
     295    float: left;
     296    border: 1px solid #ccc;
     297    background-color: #f1f1f1;
     298    width: 10%;
     299    button {
     300      display: block;
     301      background-color: inherit;
     302      color: black;
     303      font-weight: bold;
     304      padding: 16px;
     305      width: 100%;
     306      border: none;
     307      outline: none;
     308      text-align: left;
     309      cursor: pointer;
     310      transition: 0.3s;
     311      &:hover {
     312        background-color: #ddd;
     313      }
     314      &.active {
     315        background-color: #ccc;
     316      }
     317    }
     318  }
     319  .tabsv-content {
     320    margin-left: 15px;
     321    background: #ffffff;
     322    float: left;
     323    width: 85%;
     324    padding: 10px;
     325    border: 1px solid #c8c8c8;
     326    > div {
     327      display: none;
     328      &:first-child {
     329        display: block;
     330      }
     331    }
     332  }
     333  //<editor-fold desc="Tabs style">
    63334  ul.tabs {
     335    height: 36px;
     336    line-height: 25px;
     337    margin: 0 0 0px;
     338    list-style: none;
     339    li {
     340      float: left;
     341      margin-right: 1px;
     342      border-radius: 5px 5px 0 0;
     343      -moz-border-radius: 5px 5px 0 0 !important;
     344      -webkit-border-radius: 5px 5px 0 0;
     345      -khtml-border-radius: 5px 5px 0 0;
     346      margin-bottom: 0;
     347    }
    64348    li.tab-current {
    65349      a {
     
    72356        -khtml-border-radius: 5px 5px 0 0;
    73357        border: 1px solid #ccc;
    74         border-bottom: 1px solid #f1f1f1;
    75         margin-bottom: -1px;
     358        border-bottom: none;
     359        margin-bottom: -2px;
     360        bottom: -2px;
     361        -webkit-box-shadow: none;
     362        -moz-box-shadow: none;
     363        box-shadow: none;
    76364      }
    77365    }
    78366    li {
    79367      a {
    80         display: block;
     368        //display: block;
    81369        padding: 5px 10px;
    82370        margin: 0 4px 0px 0;
    83         color: #111;
    84         font-size: 12pt;
    85         text-transform: uppercase;
     371        //color: @color_2;
     372        //font-size: 12pt;
     373        //text-transform: uppercase;
     374        //text-decoration: none;
     375        //cursor: pointer;
     376        //background: #afafaf;
     377        //border: 1px solid #ccc;
     378        //border-bottom: 0px solid #F9F9F9;
     379        position: relative;
     380        //border-radius: 5px 5px 0 0;
     381        //-moz-border-radius: 5px 5px 0 0 !important;
     382        //-webkit-border-radius: 5px 5px 0 0;
     383        //-khtml-border-radius: 5px 5px 0 0;
     384        background: #444;
     385        border: 1px solid rgba(0, 0, 0, 0.15);
     386        -webkit-border-radius: 2px;
     387        -moz-border-radius: 5px 5px 0 0;
     388        border-radius: 5px 5px 0 0;
     389        -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
     390        -moz-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
     391        box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
     392        color: #FFF;
     393        cursor: pointer;
     394        display: inline-block;
     395        font-family: inherit;
     396        font-size: 20px;
     397        font-weight: 500;
     398        text-align: center;
     399        //padding: 8px 20px;
     400        text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    86401        text-decoration: none;
    87         cursor: pointer;
    88         background: #afafaf;
    89         border: 1px solid #ccc;
    90         border-bottom: 0px solid #F9F9F9;
    91         position: relative;
    92         border-radius: 5px 5px 0 0;
    93         -moz-border-radius: 5px 5px 0 0 !important;
    94         -webkit-border-radius: 5px 5px 0 0;
    95         -khtml-border-radius: 5px 5px 0 0;
    96       }
    97     }
    98   }
    99   .btn.disable {
    100     background-color: #BABABA !important;
    101     cursor: default;
    102   }
    103   .spinner {
    104     visibility: visible;
    105     display: none;
    106   }
    107   form#settings {
    108     .spinner {
    109       float: none;
    110       position: relative;
    111       top: 3px;
    112     }
    113   }
    114   .description {
    115     font-size: 11px;
    116     color: gray;
    117   }
    118   .red {
    119     color: red;
    120   }
    121   .t6.update a {
    122     border: 2px solid #ef9a07;
    123     border-bottom: none;
    124     background-color: #e69200;
    125     color: white;
    126   }
    127   div.t {
     402      }
     403    }
     404  }
     405  div.t2 {
    128406    display: none;
    129407    float: left;
     
    135413    padding: 15px 20px;
    136414    border: 1px solid #ccc;
    137 
    138   }
    139   .t1 {
     415    #bulk-op {
     416      float: left;
     417      width: 99.7%;
     418      margin-bottom: 10px;
     419      .left {
     420        float: left;
     421      }
     422      .right {
     423        float: right;
     424      }
     425      select {
     426        height: auto;
     427        padding: 6px 24px 6px 7px;
     428        position: relative;
     429        top: -3px;
     430      }
     431      input {
     432        padding: 4px 20px;
     433      }
     434    }
     435  }
     436  div.t1,
     437  div.t3,
     438  div.t4,
     439  div.t5,
     440  div.t6 {
     441    display: none;
     442    float: left;
     443    width: calc(100% - 60px);
     444    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
     445    -moz-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
     446    -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
     447    -khtml-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
     448    padding: 15px 20px;
     449    border: 1px solid #ccc;
     450  }
     451  div.t5 {
     452    #existing-backups {
     453      width: 100%;
     454      table {
     455        width: 100%;
     456      }
     457      td {
     458        background-color: #fff;
     459        padding-left: 15px;
     460        width: 23%;
     461        border: none;
     462      }
     463    }
     464  }
     465  div.t1 {
    140466    form {
    141467      max-width: 400px;
     
    160486      }
    161487    }
     488  }
     489  form#log-list{
     490    select {
     491      padding: 0;
     492    }
     493  }
     494  //<editor-fold desc="Common styles">
     495  .btn.disable {
     496    background-color: #ddd !important;
     497    cursor: default;
     498    color: #ababab;
     499  }
     500  .spinner {
     501    visibility: visible;
     502    display: none;
     503  }
     504  form#settings {
     505    .spinner {
     506      float: none;
     507      position: relative;
     508      top: 3px;
     509    }
     510  }
     511  form#compare {
     512    .row {
     513      width: 100%;
     514      float: left;
     515      clear:both;
     516      position: relative;
     517    }
     518    .col {float: left;
     519      position: relative;}
     520    .col-md-6 {width: 47%;}
     521    textarea {width: 100%;}
     522  }
     523  .mt-1 {
     524    margin-top: 10px;
     525  }
     526  .mt-2 {
     527    margin-top: 20px;
     528  }
     529  .mr-1 {
     530    margin-right: 10px;
     531  }
     532  .description {
     533    font-size: 11px;
     534    color: @color_3;
     535  }
     536  .red {
     537    color: @color_4;
    162538  }
    163539  .btn {
     
    170546    -moz-box-shadow: 0 2px 3px rgba(0,0,0,.15),inset 1px 1px 1px rgba(255,255,255,.2);
    171547    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    172     color: #FFF;
     548    color: @color_5;
    173549    cursor: pointer;
    174550    display: inline-block;
    175     font-family: inherit;
     551    font-family: @font_family_1;
    176552    font-size: 20px;
    177553    font-weight: 500;
     
    182558  }
    183559  .btn.little {
    184     font-size: 14px;
    185     padding: 4px 7px;
    186   }
    187 
    188   .premium {
    189     ol {
     560    .btn-little;
     561  }
     562
     563
     564  //</editor-fold>
     565
     566  //<editor-fold desc="Scheduler styles">
     567  #add-new-job {
     568    width: 60%;
     569    .title {
     570      width: 100%;
     571      background-color: @background_color_4;
     572      padding: 6px;
     573      cursor: pointer;
     574      margin-bottom: 0;
     575      border-radius: 5px 5px 0 0;
     576    }
     577    form {
     578      display: none;
     579    }
     580  }
     581  .form-style-1 {
     582    margin: 0;
     583    max-width: 520px;
     584    padding: 20px 12px 10px 20px;
     585    font: 13px "Lucida Sans Unicode", "Lucida Grande", sans-serif;
     586    li {
     587      padding: 0;
     588      display: block;
    190589      list-style: none;
    191       counter-reset: item;
    192       margin-left: 1em;
    193       margin-right: 1em;
    194     }
    195     li {
    196       counter-increment: item;
    197       margin-bottom: 5px;
    198       &:before {
    199         margin-right: 10px;
    200         content: counter(item);
    201         background: lightblue;
    202         border-radius: 100%;
    203         color: white;
    204         width: 1.8em;
    205         height: 1.5em;
    206         text-align: center;
     590      margin: 10px 0 0 0;
     591      >span.task-name {
    207592        display: inline-block;
    208         font-weight: bold;
    209         padding-top: 3px;
    210       }
    211     }
    212     section {
    213       float: left;
    214       padding: 10px 0;
    215       &.info-block {
    216         float: right;
    217         padding: 5px 5px 5px 0;
    218         background-color: white;
    219         border: 2px solid #e69200;
    220         position: relative;
    221         top: -45px;
    222       }
    223       form {
    224         max-width: 300px;
    225         label {
    226           font-weight: bold;
    227           input {
    228             width: 200px;
    229             margin-left: 10px;
    230           }
    231           +input.btn {
    232             position: relative;
    233             left: 27px;
    234             margin: 10px auto 0;
    235             display: block;
    236             width: auto;
    237           }
    238         }
    239       }
    240     }
    241     .btn {
    242       width: 44px;
     593        width: 44%;
     594      }
     595      >span.time {
     596        display: inline-block;
     597        width: 40%;
     598      }
     599    }
     600    label {
     601      margin: 0 0 3px 0;
     602      padding: 0px;
    243603      display: block;
    244       margin: 0 auto;
    245     }
    246   }
    247 }
    248 #add-new-job {
    249   width: 60%;
    250   .title {
    251     width: 100%;
    252     background-color: #98989833;
    253     padding: 6px;
    254     cursor: pointer;
    255     margin-bottom: 0;
    256     border-radius: 5px 5px 0 0;
    257   }
    258   form {
    259     display: none;
    260   }
    261 }
    262 .form-style-1 {
    263   margin: 0;
    264   max-width: 520px;
    265   padding: 20px 12px 10px 20px;
    266   font: 13px "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    267   li {
    268     padding: 0;
    269     display: block;
    270     list-style: none;
    271     margin: 10px 0 0 0;
    272     >span.task-name {
     604      font-weight: bold;
     605    }
     606    input[type=text] {
     607      box-sizing: border-box;
     608      -webkit-box-sizing: border-box;
     609      -moz-box-sizing: border-box;
     610      border: 1px solid #BEBEBE;
     611      padding: 7px;
     612      margin: 0px;
     613      -webkit-transition: all 0.30s ease-in-out;
     614      -moz-transition: all 0.30s ease-in-out;
     615      -ms-transition: all 0.30s ease-in-out;
     616      -o-transition: all 0.30s ease-in-out;
     617      outline: none;
     618      &:focus {
     619        -moz-box-shadow: 0 0 8px #88D5E9;
     620        -webkit-box-shadow: 0 0 8px #88D5E9;
     621        box-shadow: 0 0 8px #88D5E9;
     622        border: 1px solid #88D5E9;
     623      }
     624    }
     625    input[type=date] {
     626      box-sizing: border-box;
     627      -webkit-box-sizing: border-box;
     628      -moz-box-sizing: border-box;
     629      border: 1px solid #BEBEBE;
     630      padding: 7px;
     631      margin: 0px;
     632      -webkit-transition: all 0.30s ease-in-out;
     633      -moz-transition: all 0.30s ease-in-out;
     634      -ms-transition: all 0.30s ease-in-out;
     635      -o-transition: all 0.30s ease-in-out;
     636      outline: none;
     637      &:focus {
     638        -moz-box-shadow: 0 0 8px #88D5E9;
     639        -webkit-box-shadow: 0 0 8px #88D5E9;
     640        box-shadow: 0 0 8px #88D5E9;
     641        border: 1px solid #88D5E9;
     642      }
     643    }
     644    input[type=datetime] {
     645      box-sizing: border-box;
     646      -webkit-box-sizing: border-box;
     647      -moz-box-sizing: border-box;
     648      border: 1px solid #BEBEBE;
     649      padding: 7px;
     650      margin: 0px;
     651      -webkit-transition: all 0.30s ease-in-out;
     652      -moz-transition: all 0.30s ease-in-out;
     653      -ms-transition: all 0.30s ease-in-out;
     654      -o-transition: all 0.30s ease-in-out;
     655      outline: none;
     656      &:focus {
     657        -moz-box-shadow: 0 0 8px #88D5E9;
     658        -webkit-box-shadow: 0 0 8px #88D5E9;
     659        box-shadow: 0 0 8px #88D5E9;
     660        border: 1px solid #88D5E9;
     661      }
     662    }
     663    input[type=number] {
     664      box-sizing: border-box;
     665      -webkit-box-sizing: border-box;
     666      -moz-box-sizing: border-box;
     667      border: 1px solid #BEBEBE;
     668      padding: 7px;
     669      margin: 0px;
     670      -webkit-transition: all 0.30s ease-in-out;
     671      -moz-transition: all 0.30s ease-in-out;
     672      -ms-transition: all 0.30s ease-in-out;
     673      -o-transition: all 0.30s ease-in-out;
     674      outline: none;
     675      &:focus {
     676        -moz-box-shadow: 0 0 8px #88D5E9;
     677        -webkit-box-shadow: 0 0 8px #88D5E9;
     678        box-shadow: 0 0 8px #88D5E9;
     679        border: 1px solid #88D5E9;
     680      }
     681    }
     682    input[type=search] {
     683      box-sizing: border-box;
     684      -webkit-box-sizing: border-box;
     685      -moz-box-sizing: border-box;
     686      border: 1px solid #BEBEBE;
     687      padding: 7px;
     688      margin: 0px;
     689      -webkit-transition: all 0.30s ease-in-out;
     690      -moz-transition: all 0.30s ease-in-out;
     691      -ms-transition: all 0.30s ease-in-out;
     692      -o-transition: all 0.30s ease-in-out;
     693      outline: none;
     694      &:focus {
     695        -moz-box-shadow: 0 0 8px #88D5E9;
     696        -webkit-box-shadow: 0 0 8px #88D5E9;
     697        box-shadow: 0 0 8px #88D5E9;
     698        border: 1px solid #88D5E9;
     699      }
     700    }
     701    input[type=time] {
     702      box-sizing: border-box;
     703      -webkit-box-sizing: border-box;
     704      -moz-box-sizing: border-box;
     705      border: 1px solid #BEBEBE;
     706      padding: 7px;
     707      margin: 0px;
     708      -webkit-transition: all 0.30s ease-in-out;
     709      -moz-transition: all 0.30s ease-in-out;
     710      -ms-transition: all 0.30s ease-in-out;
     711      -o-transition: all 0.30s ease-in-out;
     712      outline: none;
     713      &:focus {
     714        -moz-box-shadow: 0 0 8px #88D5E9;
     715        -webkit-box-shadow: 0 0 8px #88D5E9;
     716        box-shadow: 0 0 8px #88D5E9;
     717        border: 1px solid #88D5E9;
     718      }
     719    }
     720    input[type=url] {
     721      box-sizing: border-box;
     722      -webkit-box-sizing: border-box;
     723      -moz-box-sizing: border-box;
     724      border: 1px solid #BEBEBE;
     725      padding: 7px;
     726      margin: 0px;
     727      -webkit-transition: all 0.30s ease-in-out;
     728      -moz-transition: all 0.30s ease-in-out;
     729      -ms-transition: all 0.30s ease-in-out;
     730      -o-transition: all 0.30s ease-in-out;
     731      outline: none;
     732      &:focus {
     733        -moz-box-shadow: 0 0 8px #88D5E9;
     734        -webkit-box-shadow: 0 0 8px #88D5E9;
     735        box-shadow: 0 0 8px #88D5E9;
     736        border: 1px solid #88D5E9;
     737      }
     738    }
     739    input[type=email] {
     740      box-sizing: border-box;
     741      -webkit-box-sizing: border-box;
     742      -moz-box-sizing: border-box;
     743      border: 1px solid #BEBEBE;
     744      padding: 7px;
     745      margin: 0px;
     746      -webkit-transition: all 0.30s ease-in-out;
     747      -moz-transition: all 0.30s ease-in-out;
     748      -ms-transition: all 0.30s ease-in-out;
     749      -o-transition: all 0.30s ease-in-out;
     750      outline: none;
     751      &:focus {
     752        -moz-box-shadow: 0 0 8px #88D5E9;
     753        -webkit-box-shadow: 0 0 8px #88D5E9;
     754        box-shadow: 0 0 8px #88D5E9;
     755        border: 1px solid #88D5E9;
     756      }
     757    }
     758    textarea {
     759      &:focus {
     760        -moz-box-shadow: 0 0 8px #88D5E9;
     761        -webkit-box-shadow: 0 0 8px #88D5E9;
     762        box-shadow: 0 0 8px #88D5E9;
     763        border: 1px solid #88D5E9;
     764      }
     765    }
     766    select {
     767      &:focus {
     768        -moz-box-shadow: 0 0 8px #88D5E9;
     769        -webkit-box-shadow: 0 0 8px #88D5E9;
     770        box-shadow: 0 0 8px #88D5E9;
     771        border: 1px solid #88D5E9;
     772      }
     773    }
     774    .field-divided {
     775      width: 49%;
     776    }
     777    .field-long {
     778      width: 100%;
     779    }
     780    .field-select {
     781      width: 100%;
     782      padding: 0;
     783    }
     784    .field-textarea {
     785      height: 100px;
     786    }
     787    input[type=button] {
     788      background: #3E61C6;
     789      border: 1px solid rgba(0, 0, 0, 0.15);
     790      -webkit-border-radius: 2px;
     791      -moz-border-radius: 2px;
     792      border-radius: 2px;
     793      -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
     794      -moz-box-shadow: 0 2px 3px rgba(0,0,0,.15),inset 1px 1px 1px rgba(255,255,255,.2);
     795      box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
     796      color: @color_5;
     797      cursor: pointer;
    273798      display: inline-block;
    274       width: 44%;
    275     }
    276     >span.time {
    277       display: inline-block;
    278       width: 40%;
    279     }
    280   }
    281   label {
    282     margin: 0 0 3px 0;
    283     padding: 0px;
    284     display: block;
    285     font-weight: bold;
    286   }
    287   input[type=text] {
     799      font-family: @font_family_1;
     800      font-size: 17px;
     801      font-weight: 500;
     802      text-align: center;
     803      padding: 3px 15px;
     804      text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
     805      text-decoration: none;
     806      &:hover {
     807        background: #4691A4;
     808        box-shadow: none;
     809        -moz-box-shadow: none;
     810        -webkit-box-shadow: none;
     811      }
     812    }
     813    .required {
     814      color: @color_4;
     815    }
     816  }
     817  textarea {
    288818    box-sizing: border-box;
    289819    -webkit-box-sizing: border-box;
     
    297827    -o-transition: all 0.30s ease-in-out;
    298828    outline: none;
    299     &:focus {
    300       -moz-box-shadow: 0 0 8px #88D5E9;
    301       -webkit-box-shadow: 0 0 8px #88D5E9;
    302       box-shadow: 0 0 8px #88D5E9;
    303       border: 1px solid #88D5E9;
    304     }
    305   }
    306   input[type=date] {
     829  }
     830  select {
    307831    box-sizing: border-box;
    308832    -webkit-box-sizing: border-box;
     
    316840    -o-transition: all 0.30s ease-in-out;
    317841    outline: none;
    318     &:focus {
    319       -moz-box-shadow: 0 0 8px #88D5E9;
    320       -webkit-box-shadow: 0 0 8px #88D5E9;
    321       box-shadow: 0 0 8px #88D5E9;
    322       border: 1px solid #88D5E9;
    323     }
    324   }
    325   input[type=datetime] {
    326     box-sizing: border-box;
    327     -webkit-box-sizing: border-box;
    328     -moz-box-sizing: border-box;
    329     border: 1px solid #BEBEBE;
    330     padding: 7px;
    331     margin: 0px;
    332     -webkit-transition: all 0.30s ease-in-out;
    333     -moz-transition: all 0.30s ease-in-out;
    334     -ms-transition: all 0.30s ease-in-out;
    335     -o-transition: all 0.30s ease-in-out;
    336     outline: none;
    337     &:focus {
    338       -moz-box-shadow: 0 0 8px #88D5E9;
    339       -webkit-box-shadow: 0 0 8px #88D5E9;
    340       box-shadow: 0 0 8px #88D5E9;
    341       border: 1px solid #88D5E9;
    342     }
    343   }
    344   input[type=number] {
    345     box-sizing: border-box;
    346     -webkit-box-sizing: border-box;
    347     -moz-box-sizing: border-box;
    348     border: 1px solid #BEBEBE;
    349     padding: 7px;
    350     margin: 0px;
    351     -webkit-transition: all 0.30s ease-in-out;
    352     -moz-transition: all 0.30s ease-in-out;
    353     -ms-transition: all 0.30s ease-in-out;
    354     -o-transition: all 0.30s ease-in-out;
    355     outline: none;
    356     &:focus {
    357       -moz-box-shadow: 0 0 8px #88D5E9;
    358       -webkit-box-shadow: 0 0 8px #88D5E9;
    359       box-shadow: 0 0 8px #88D5E9;
    360       border: 1px solid #88D5E9;
    361     }
    362   }
    363   input[type=search] {
    364     box-sizing: border-box;
    365     -webkit-box-sizing: border-box;
    366     -moz-box-sizing: border-box;
    367     border: 1px solid #BEBEBE;
    368     padding: 7px;
    369     margin: 0px;
    370     -webkit-transition: all 0.30s ease-in-out;
    371     -moz-transition: all 0.30s ease-in-out;
    372     -ms-transition: all 0.30s ease-in-out;
    373     -o-transition: all 0.30s ease-in-out;
    374     outline: none;
    375     &:focus {
    376       -moz-box-shadow: 0 0 8px #88D5E9;
    377       -webkit-box-shadow: 0 0 8px #88D5E9;
    378       box-shadow: 0 0 8px #88D5E9;
    379       border: 1px solid #88D5E9;
    380     }
    381   }
    382   input[type=time] {
    383     box-sizing: border-box;
    384     -webkit-box-sizing: border-box;
    385     -moz-box-sizing: border-box;
    386     border: 1px solid #BEBEBE;
    387     padding: 7px;
    388     margin: 0px;
    389     -webkit-transition: all 0.30s ease-in-out;
    390     -moz-transition: all 0.30s ease-in-out;
    391     -ms-transition: all 0.30s ease-in-out;
    392     -o-transition: all 0.30s ease-in-out;
    393     outline: none;
    394     &:focus {
    395       -moz-box-shadow: 0 0 8px #88D5E9;
    396       -webkit-box-shadow: 0 0 8px #88D5E9;
    397       box-shadow: 0 0 8px #88D5E9;
    398       border: 1px solid #88D5E9;
    399     }
    400   }
    401   input[type=url] {
    402     box-sizing: border-box;
    403     -webkit-box-sizing: border-box;
    404     -moz-box-sizing: border-box;
    405     border: 1px solid #BEBEBE;
    406     padding: 7px;
    407     margin: 0px;
    408     -webkit-transition: all 0.30s ease-in-out;
    409     -moz-transition: all 0.30s ease-in-out;
    410     -ms-transition: all 0.30s ease-in-out;
    411     -o-transition: all 0.30s ease-in-out;
    412     outline: none;
    413     &:focus {
    414       -moz-box-shadow: 0 0 8px #88D5E9;
    415       -webkit-box-shadow: 0 0 8px #88D5E9;
    416       box-shadow: 0 0 8px #88D5E9;
    417       border: 1px solid #88D5E9;
    418     }
    419   }
    420   input[type=email] {
    421     box-sizing: border-box;
    422     -webkit-box-sizing: border-box;
    423     -moz-box-sizing: border-box;
    424     border: 1px solid #BEBEBE;
    425     padding: 7px;
    426     margin: 0px;
    427     -webkit-transition: all 0.30s ease-in-out;
    428     -moz-transition: all 0.30s ease-in-out;
    429     -ms-transition: all 0.30s ease-in-out;
    430     -o-transition: all 0.30s ease-in-out;
    431     outline: none;
    432     &:focus {
    433       -moz-box-shadow: 0 0 8px #88D5E9;
    434       -webkit-box-shadow: 0 0 8px #88D5E9;
    435       box-shadow: 0 0 8px #88D5E9;
    436       border: 1px solid #88D5E9;
    437     }
    438   }
    439   textarea {
    440     &:focus {
    441       -moz-box-shadow: 0 0 8px #88D5E9;
    442       -webkit-box-shadow: 0 0 8px #88D5E9;
    443       box-shadow: 0 0 8px #88D5E9;
    444       border: 1px solid #88D5E9;
    445     }
    446   }
    447   select {
    448     &:focus {
    449       -moz-box-shadow: 0 0 8px #88D5E9;
    450       -webkit-box-shadow: 0 0 8px #88D5E9;
    451       box-shadow: 0 0 8px #88D5E9;
    452       border: 1px solid #88D5E9;
    453     }
    454   }
    455   .field-divided {
    456     width: 49%;
    457   }
    458   .field-long {
     842  }
     843  table#scheduller-jobs {
    459844    width: 100%;
    460   }
    461   .field-select {
     845    margin-top: 10px;
     846  }
     847
     848  //</editor-fold>
     849
     850  //<editor-fold desc="Sites list styles">
     851  .container.sites-list,
     852  .container.existing-list {
     853    table.top-options {
     854      width: 100%;
     855      position: relative;
     856      td.first {
     857        padding-left: 28px;
     858      }
     859      .spinner {
     860        display: block;
     861        float: left;
     862        position: absolute;
     863        left: -3px;
     864        top: 22px;
     865      }
     866      td.per-page {
     867        font-weight: bold;
     868        span:not(.per-page) {
     869          color: #1d94cf;
     870          &:hover:not(.current) {
     871            cursor: pointer;
     872            text-decoration: underline;
     873          }
     874          &.current {
     875            color: inherit;
     876          }
     877        }
     878      }
     879    }
     880  }
     881  .container.existing-list {
     882    table.top-options {
     883      border-collapse: collapse;
     884      .spinner {
     885        top: 11px;
     886        left: -5px;
     887      }
     888      td {
     889        &.first {
     890          padding: 0;
     891          width: 31px;
     892        }
     893        &.per-page {
     894          width: 60%;
     895          padding-left: 0;
     896          + td {
     897            text-align: right;
     898          }
     899        }
     900      }
     901    }
     902  }
     903  table#sites-list {
    462904    width: 100%;
    463   }
    464   .field-textarea {
    465     height: 100px;
    466   }
    467   input[type=submit] {
    468     background: #3E61C6;
    469     border: 1px solid rgba(0, 0, 0, 0.15);
    470     -webkit-border-radius: 2px;
    471     -moz-border-radius: 2px;
    472     border-radius: 2px;
    473     -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    474     -moz-box-shadow: 0 2px 3px rgba(0,0,0,.15),inset 1px 1px 1px rgba(255,255,255,.2);
    475     box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    476     color: #FFF;
    477     cursor: pointer;
    478     display: inline-block;
    479     font-family: inherit;
    480     font-size: 17px;
    481     font-weight: 500;
    482     text-align: center;
    483     padding: 3px 15px;
    484     text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    485     text-decoration: none;
    486     &:hover {
    487       background: #4691A4;
    488       box-shadow: none;
    489       -moz-box-shadow: none;
    490       -webkit-box-shadow: none;
    491     }
    492   }
    493   input[type=button] {
    494     background: #3E61C6;
    495     border: 1px solid rgba(0, 0, 0, 0.15);
    496     -webkit-border-radius: 2px;
    497     -moz-border-radius: 2px;
    498     border-radius: 2px;
    499     -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    500     -moz-box-shadow: 0 2px 3px rgba(0,0,0,.15),inset 1px 1px 1px rgba(255,255,255,.2);
    501     box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    502     color: #FFF;
    503     cursor: pointer;
    504     display: inline-block;
    505     font-family: inherit;
    506     font-size: 17px;
    507     font-weight: 500;
    508     text-align: center;
    509     padding: 3px 15px;
    510     text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    511     text-decoration: none;
    512     &:hover {
    513       background: #4691A4;
    514       box-shadow: none;
    515       -moz-box-shadow: none;
    516       -webkit-box-shadow: none;
    517     }
    518   }
    519   .required {
    520     color: red;
    521   }
    522 }
    523 textarea {
    524   box-sizing: border-box;
    525   -webkit-box-sizing: border-box;
    526   -moz-box-sizing: border-box;
    527   border: 1px solid #BEBEBE;
    528   padding: 7px;
    529   margin: 0px;
    530   -webkit-transition: all 0.30s ease-in-out;
    531   -moz-transition: all 0.30s ease-in-out;
    532   -ms-transition: all 0.30s ease-in-out;
    533   -o-transition: all 0.30s ease-in-out;
    534   outline: none;
    535 }
    536 select {
    537   box-sizing: border-box;
    538   -webkit-box-sizing: border-box;
    539   -moz-box-sizing: border-box;
    540   border: 1px solid #BEBEBE;
    541   padding: 7px;
    542   margin: 0px;
    543   -webkit-transition: all 0.30s ease-in-out;
    544   -moz-transition: all 0.30s ease-in-out;
    545   -ms-transition: all 0.30s ease-in-out;
    546   -o-transition: all 0.30s ease-in-out;
    547   outline: none;
    548 }
    549 table#scheduller-jobs {
    550   width: 100%;
    551   margin-top: 10px;
    552   thead {
    553     tr {
    554       background-color: #afafaf;
    555     }
    556   }
    557   tbody {
    558     td {
    559       background-color: ghostwhite;
    560       padding-left: 15px;
    561       width: 23%;
    562     }
    563   }
    564 }
    565 table#sites-list {
    566   width: 100%;
    567   margin-top: 10px;
    568   thead {
    569     tr {
    570       background-color: #afafaf;
    571     }
    572   }
    573   tbody {
    574     td {
    575       background-color: ghostwhite;
    576       padding-left: 15px;
    577     }
    578     td.action {
    579       width: 23%;
    580     }
    581   }
    582   div.hidden {
     905    margin-top: 10px;
     906    tbody {
     907      td.links {
     908        img {
     909          height: 20px;
     910          position: relative;
     911          top: 4px;
     912        }
     913      }
     914      td.action {
     915        width: 23%;
     916      }
     917    }
     918    div.hidden {
     919      display: none;
     920    }
     921  }
     922  .progressbar {
     923    margin-top: 20px;
     924    margin-bottom: 10px;
     925    height: auto;
     926    background: #f6f6f6;
     927    border: 1px solid #e6e6e6;
     928    border-radius: 7px;
     929    overflow: hidden;
    583930    display: none;
    584   }
    585 }
    586 table#backups-settings {
    587   thead {
    588     tr {
    589       background-color: #afafaf;
    590     }
    591   }
    592   tbody {
    593     td {
    594       background-color: ghostwhite;
    595       padding-left: 15px;
    596     }
    597   }
    598 }
    599 .progressbar {
    600   margin-top: 20px;
    601   margin-bottom: 10px;
    602   height: auto;
    603   background: #f6f6f6;
    604   border: 1px solid #e6e6e6;
    605   border-radius: 7px;
    606   overflow: hidden;
     931    #progresssteps {
     932      background: #7db9e8;
     933      background: -moz-linear-gradient(top, #7db9e8 0%, #7db9e8 5%, #207cca 55%, #2989d8 100%);
     934      background: -webkit-linear-gradient(top, #7db9e8 0%,#7db9e8 5%,#207cca 55%,#2989d8 100%);
     935      background: linear-gradient(to bottom, #7db9e8 0%,#7db9e8 5%,#207cca 55%,#2989d8 100%);
     936      filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7db9e8', endColorstr='#2989d8',GradientType=0 );
     937      -webkit-transition: width .6s ease;
     938      -o-transition: width .6s ease;
     939      transition: width .6s ease;
     940      -webkit-animation: progress-bar-stripes 2s linear infinite;
     941      -o-animation: progress-bar-stripes 2s linear infinite;
     942      animation: progress-bar-stripes 2s linear infinite;
     943    }
     944    .bwpu-progress {
     945      background-color: @background_color_7;
     946      color: @color_6;
     947      padding: 5px 0;
     948      text-align: center;
     949    }
     950  }
     951  a {
     952    color: #09f;
     953  }
     954  a.btn, .btn {
     955    .btn-light;
     956  }
     957
     958  //</editor-fold>
     959
     960  //<editor-fold desc="storage settings styles">
     961  .storage-settings {
     962    .ftp-form;
     963  }
     964  //</editor-fold>
     965}
     966
     967// popup
     968.ftp-inner-box {
     969  .ftp-form;
     970  form {
     971    padding-top: 20px;
     972    margin: 0 auto;
     973    .field span {
     974      label {
     975        float: left !important;
     976      }
     977      input {
     978        float: right !important;
     979      }
     980    }
     981    .field fieldset {
     982      width: calc(100% - 20px) !important;
     983      border-color: #ddd;
     984    }
     985    #return-restore {
     986      border: none;
     987      color: red;
     988      float: right;
     989    }
     990    //.btn {
     991    //  .btn-light;
     992    //}
     993  }
     994}
     995
     996#restore-admin-panel {
    607997  display: none;
    608   #progresssteps {
    609     background: #7db9e8;
    610     background: -moz-linear-gradient(top, #7db9e8 0%, #7db9e8 5%, #207cca 55%, #2989d8 100%);
    611     background: -webkit-linear-gradient(top, #7db9e8 0%,#7db9e8 5%,#207cca 55%,#2989d8 100%);
    612     background: linear-gradient(to bottom, #7db9e8 0%,#7db9e8 5%,#207cca 55%,#2989d8 100%);
    613     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7db9e8', endColorstr='#2989d8',GradientType=0 );
    614     -webkit-transition: width .6s ease;
    615     -o-transition: width .6s ease;
    616     transition: width .6s ease;
    617     -webkit-animation: progress-bar-stripes 2s linear infinite;
    618     -o-animation: progress-bar-stripes 2s linear infinite;
    619     animation: progress-bar-stripes 2s linear infinite;
    620   }
    621   .bwpu-progress {
    622     background-color: #1d94cf;
    623     color: #fff;
    624     padding: 5px 0;
    625     text-align: center;
    626   }
    627 }
    628 #bulk-op {
    629   a.btn {
    630     background: #3E61C6;
    631     border: 1px solid rgba(0, 0, 0, 0.15);
    632     -webkit-border-radius: 2px;
    633     -moz-border-radius: 2px;
    634     border-radius: 2px;
    635     -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    636     -moz-box-shadow: 0 2px 3px rgba(0,0,0,.15),inset 1px 1px 1px rgba(255,255,255,.2);
    637     box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    638     color: #FFF;
    639     cursor: pointer;
    640     display: inline-block;
    641     font-family: inherit;
    642     font-size: 20px;
    643     font-weight: 500;
    644     text-align: center;
    645     padding: 8px 20px;
    646     text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    647     text-decoration: none;
    648   }
    649 }
    650 #sites-list {
    651   a.btn {
    652     background: #3E61C6;
    653     border: 1px solid rgba(0, 0, 0, 0.15);
    654     -webkit-border-radius: 2px;
    655     -moz-border-radius: 2px;
    656     border-radius: 2px;
    657     -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    658     -moz-box-shadow: 0 2px 3px rgba(0,0,0,.15),inset 1px 1px 1px rgba(255,255,255,.2);
    659     box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    660     color: #FFF;
    661     cursor: pointer;
    662     display: inline-block;
    663     font-family: inherit;
    664     font-size: 20px;
    665     font-weight: 500;
    666     text-align: center;
    667     padding: 8px 20px;
    668     text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    669     text-decoration: none;
    670     font-size: 14px;
    671     padding: 4px 7px;
    672   }
    673 }
    674 
    675 .storage-settings {
    676   form {
    677     .btn {
    678       background: #3E61C6;
    679       border: 1px solid rgba(0, 0, 0, 0.15);
    680       -webkit-border-radius: 2px;
    681       -moz-border-radius: 2px;
    682       border-radius: 2px;
    683       -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    684       -moz-box-shadow: 0 2px 3px rgba(0,0,0,.15),inset 1px 1px 1px rgba(255,255,255,.2);
    685       box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15),inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    686       color: #FFF;
    687       cursor: pointer;
    688       display: inline-block;
    689       font-family: inherit;
    690       font-size: 20px;
    691       font-weight: 500;
    692       text-align: center;
    693       padding: 8px 20px;
    694       text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15);
    695       text-decoration: none;
    696       font-size: 14px;
    697       padding: 4px 7px;
    698     }
    699     max-width: 400px;
    700     width: 100%;
    701     .field {
    702       float: left;
    703       width: 100%;
    704       margin-bottom: 7px;
    705       label {
    706         float: left;
    707       }
    708       input {
    709         float: right;
    710       }
    711       >span {
    712         label {
    713           float: none !important;
    714         }
    715         input {
    716           float: none !important;
    717         }
    718       }
    719       input.btn {
    720         float: none !important;
    721       }
    722       fieldset {
    723         label {
    724           float: none !important;
    725         }
    726         input {
    727           float: none !important;
    728         }
    729         width: 50%;
    730         border: 1px solid #b6b6b6;
    731         padding: 10px;
    732       }
    733     }
    734     .field.num {
    735       width: 50%;
    736       label {
    737         position: relative;
    738         top: 5px;
    739         font-weight: bold;
    740       }
    741       input {
    742         width: 52px;
    743         text-align: center;
    744         padding: 2px;
    745       }
    746     }
    747   }
    748   .connected {
    749     span {
    750       font-weight: bold;
    751       color: green;
    752     }
    753     span.no {
    754       color: red;
    755     }
    756   }
    757 }
    758 
    759 @media all and (max-width: 900px) {
    760   #backupsavvy-settings {
    761     .premium {
    762       section {
    763         float: none;
    764         margin-bottom: 10px;
    765         &.info-block {
    766           top: 0;
    767           float: none;
    768         }
    769       }
    770     }
    771   }
    772 }
     998}
     999#restore-admin-panel-inner {
     1000  margin-top: 22px;
     1001  a {
     1002    margin: 10px;
     1003  }
     1004  .btn {
     1005    .btn-light;
     1006  }
     1007}
     1008
     1009// phpinfo reset styles
     1010#phpinfo {}
     1011#phpinfo pre {
     1012  pre,
     1013  a:link,
     1014  a:hover,
     1015  table,
     1016  .center,
     1017  .center table,
     1018  .center th,
     1019  td,th,h1,h2,.p,.e,.h,v,img,hr {}
     1020}
     1021
     1022#phpinfo {}
     1023#phpinfo pre {}
     1024#phpinfo a:link {}
     1025#phpinfo a:hover {}
     1026#phpinfo table {}
     1027#phpinfo .center {}
     1028#phpinfo .center table {}
     1029#phpinfo .center th {}
     1030#phpinfo td, th {}
     1031#phpinfo h1 {}
     1032#phpinfo h2 {}
     1033#phpinfo .p {}
     1034#phpinfo .e {}
     1035#phpinfo .h {}
     1036#phpinfo .v {}
     1037#phpinfo .vr {}
     1038#phpinfo img {}
     1039#phpinfo hr {}
     1040
     1041
     1042
     1043
  • backupsavvy/trunk/inc/BackUpSavvyActivation.php

    r2127907 r2236496  
    22
    33class backUpSavvyActivation {
     4
    45    public function __construct() {
    56    }
     
    89    public static function deactivate() {
    910        global $wpdb;
    10         $table_name = $wpdb->prefix . "backup_savvy_records";
    11         $sql = "DROP TABLE IF EXISTS $table_name";
    12         $wpdb->query($sql);
     11
     12//      $table_name = $wpdb->prefix . "backup_savvy_records";
     13//      $sql = "DROP TABLE IF EXISTS $table_name";
     14//      $wpdb->query($sql);
     15
    1316        $table_name = $wpdb->prefix . "backup_savvy_reports";
    1417        $sql_rep = "DROP TABLE IF EXISTS $table_name";
    1518        $wpdb->query($sql_rep);
     19
     20        delete_option('backupsavvy_storage');
     21        delete_option('backupsavvy_backup_settings');
     22        delete_option('backupsavvy_apikey');
     23        delete_option('backupsavvy_db_version');
    1624    }
    1725
    1826    public static function activate() {
     27        global $wpdb;
    1928
    20     require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    21 
    22         global $wpdb;
     29    require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    2330
    2431        // creating new table
    2532        $table_name = $wpdb->prefix . "backup_savvy_records";
     33        $sqls = array();
     34
    2635        if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
    2736
     
    3443                  protection VARCHAR(55) NOT NULL,
    3544                  unique_id VARCHAR(55) NOT NULL,
    36                   time DATE DEFAULT '0' NOT NULL,
     45                  time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
    3746                  UNIQUE KEY id (id),
    3847                  UNIQUE KEY unique_id (unique_id)
    3948                );";
    40 
    41             dbDelta( $sql );
     49      dbDelta( $sql );
    4250        }
    4351
     
    4755                  id mediumint(9) NOT NULL AUTO_INCREMENT,
    4856                  url VARCHAR(55) NOT NULL,
     57                  action VARCHAR(55) NOT NULL,
    4958                  status VARCHAR(55) NOT NULL,
    5059                  unique_id VARCHAR(55) NOT NULL,
    51                   time date DEFAULT '0' NOT NULL,
    52                   UNIQUE KEY id (id),
    53                   UNIQUE KEY unique_id (unique_id)
     60                  backup_name VARCHAR(55) NOT NULL,
     61                  time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
     62                  UNIQUE KEY id (id)
    5463                );";
    5564
    56             dbDelta($sql_rep);
     65      dbDelta( $sql_rep );
    5766        }
    5867
    5968        update_option('backupsavvy_apikey', '53t181Hf3Xe8f80we472aye7695167V9Q08a4c');
     69
     70        // default backup settings
     71        $settings = array(
     72            'amount' => 4,
     73            'method' => 'tarGz',
     74            'compr' => 'norm'
     75        );
     76        update_option('backupsavvy_backup_settings', $settings);
    6077    }
    6178
     79  public static function plugin_update($new_db_version) {
     80      global $wpdb;
    6281
     82    $table_name = $wpdb->prefix . 'backup_savvy_reports';
     83    $check_action = (array) $wpdb->get_results(  "SELECT count(COLUMN_NAME) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME = '{$wpdb->prefix}backup_savvy_reports' AND COLUMN_NAME = 'action'"  )[0];
     84    $check_backup_name = (array) $wpdb->get_results(  "SELECT count(COLUMN_NAME) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME = '{$wpdb->prefix}backup_savvy_reports' AND column_name = 'backup_name'"  )[0];
     85    $check_data = (array) $wpdb->get_results(  "SELECT count(COLUMN_NAME) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME = '{$wpdb->prefix}backup_savvy_reports' AND column_name = 'data'"  )[0];
     86
     87    $check_action = (int) array_shift($check_action);
     88    $check_backup_name = (int) array_shift($check_backup_name);
     89    $check_data = (int) array_shift($check_data);
     90
     91    if($check_action == 0) {
     92      $wpdb->query(
     93        "ALTER TABLE $table_name
     94           ADD COLUMN `action` VARCHAR(55) NOT NULL
     95          ");
     96    }
     97
     98    if($check_backup_name == 0)
     99      $wpdb->query(
     100        "ALTER TABLE $table_name
     101           ADD COLUMN `backup_name` VARCHAR(55) NOT NULL
     102          ");
     103
     104    if($check_data == 0)
     105      $wpdb->query(
     106        "ALTER TABLE $table_name
     107           ADD COLUMN `data` VARCHAR(128) DEFAULT NULL
     108          ");
     109
     110    update_option('backupsavvy_db_version', $new_db_version);
     111  }
    63112}
  • backupsavvy/trunk/inc/BackUpSavvyBackup.php

    r1922435 r2236496  
    11<?php
    22
    3 class backUpSavvyBackup {
     3class backUpSavvyBackup
     4{
    45  protected $apikey;
    56
    6     public function __construct() {
    7       $this->apikey = get_option('backupsavvy_apikey', FALSE);
    8     }
     7  public function __construct()
     8  {
     9    $this->apikey = get_option('backupsavvy_apikey', FALSE);
     10  }
    911
    10     public function backup_one($site) {
     12  public function backup_one($site)
     13  {
     14    if (!ini_get('safe_mode')) {
     15      @set_time_limit(0);
     16    }
     17    $protection = md5($site->protection.'.bcssvy');
    1118
    12     $postUrl = $site->url.'/wp-json/backupsavvyapi/backup';
     19    $postUrl = $site->url . '/wp-json/backupsavvyapi/backup';
    1320    $args = array(
    14       'timeout'     => 500, // seconds
     21      'timeout' => 500, // seconds
    1522      'redirection' => 5,
    1623      'httpversion' => '1.0',
    17       'blocking'    => true,
    18       'headers'     => array(),
    19       'body'        => array(
     24      'blocking' => true,
     25      'headers' => array(),
     26      'body' => array(
    2027        'apikey' => $this->apikey,
    21         'secret' => $site->protection
     28        'secret' => $protection,
    2229      ),
    23       'cookies'     => array(),
    24       'sslverify'   => false
     30      'cookies' => array(),
     31      'sslverify' => false
    2532    );
    2633
    27     $response = wp_remote_post( $postUrl, $args );
     34    $response = wp_remote_post($postUrl, $args);
    2835
    29     if ( is_wp_error( $response ) ) {
     36    if (is_wp_error($response)) {
    3037      $error_message = $response->get_error_message();
    3138      $data = array(
    3239        'url' => $site->url,
    33         'status' => '$response->get_error_message()',
    34         'unique_id' => $site->unique_id
     40        'status' => $error_message,
     41        'unique_id' => $site->unique_id,
     42        'action' => 'backup'
    3543      );
    3644
    3745      $this->save_report($data);
     46      $this->save_log_file($data);
    3847      return $error_message;
    3948    }
    4049
    41         $res = (object) json_decode($response['body']);
    42         if(!json_last_error() == JSON_ERROR_NONE) {
    43             $data = array(
    44                 'url' => $site->url,
    45                 'status' => 'error',
    46                 'unique_id' => $site->unique_id
    47             );
    48 
    49             $this->save_report($data);
    50             return false;
    51         }
    52 
    53     $res =(object) json_decode($response['body']);
    54 
    55 //      error_log('br='.print_r($result,true));
    56 //      error_log('br2='.print_r($res,true));
    57         $data = array(
    58             'url' => $site->url,
    59             'status' => $res->status,
    60             'unique_id' => $site->unique_id
    61         );
    62 
    63         $this->save_report($data);
    64 
    65         return $res->status;
    66     }
    67 
    68     public function upload_one($site) {
    69     $postUrl = $site->url.'/wp-json/backupsavvyapi/upload';
    70 
    71     $args = array(
    72       'timeout'     => 500, // seconds
    73       'redirection' => 5,
    74       'httpversion' => '1.0',
    75       'blocking'    => true,
    76       'headers'     => array(),
    77       'body'        => array(
    78         'apikey' => $this->apikey,
    79         'secret' => $site->protection
    80       ),
    81       'cookies'     => array(),
    82       'sslverify'   => false
    83     );
    84 
    85     $response = wp_remote_post( $postUrl, $args );
    86 
    87     if ( is_wp_error( $response ) ) {
    88       $error_message = $response->get_error_message();
    89       error_log($error_message);
     50    if (!json_last_error() == JSON_ERROR_NONE) {
    9051      $data = array(
    9152        'url' => $site->url,
    92         'status' => 'error: '.$error_message,
    93         'unique_id' => $site->unique_id
     53        'status' => 'error',
     54        'unique_id' => $site->unique_id,
     55        'action' => 'backup'
    9456      );
    9557
    9658      $this->save_report($data);
     59      $this->save_log_file($data);
     60      return false;
     61    }
     62
     63    $res = (object)json_decode($response['body']);
     64
     65    $status = 'success';
     66    if (!isset($res->status))
     67      $status = array('backup_error');
     68
     69    $backup_name = '';
     70    if(isset($res->backup))
     71      $backup_name = basename($res->backup);
     72    $data = array(
     73      'url' => $site->url,
     74      'status' => $status,
     75      'unique_id' => $site->unique_id,
     76      'action' => 'backup',
     77      'backup_name' => $backup_name
     78    );
     79
     80    $this->save_report($data);
     81    $this->save_log_file($data);
     82
     83    return $status;
     84  }
     85
     86  public function upload_one($site)
     87  {
     88    $postUrl = $site->url . '/wp-json/backupsavvyapi/upload';
     89    $protection = md5($site->protection.'.bcssvy');
     90//        error_log('upload '.print_r($site, true));
     91    $args = array(
     92      'timeout' => 1800, // seconds
     93      'redirection' => 5,
     94      'httpversion' => '1.0',
     95      'blocking' => true,
     96      'headers' => array(),
     97      'body' => array(
     98        'apikey' => $this->apikey,
     99        'secret' => $protection
     100      ),
     101      'cookies' => array(),
     102      'sslverify' => false
     103    );
     104
     105    $response = wp_remote_post($postUrl, $args);
     106
     107    if (is_wp_error($response)) {
     108      $error_message = $response->get_error_message();
     109      error_log('error_message ' . print_r($error_message, true));
     110      $data = array(
     111        'url' => $site->url,
     112        'status' => 'error: upload error',
     113        'unique_id' => $site->unique_id,
     114        'action' => 'upload'
     115      );
     116//            error_log('before_save_report');
     117//            error_log('data '.print_r($data, true));
     118      $this->save_report($data);
     119      $this->save_log_file($data, 'append');
     120//            error_log('after_save_report');
    97121      return 'error';
    98122    } else {
    99       $res =(object) json_decode($response['body']);
     123      $res = (object)json_decode($response['body']);
    100124
    101         $data = array(
    102           'url' => $site->url,
    103           'status' => $res->status,
    104           'unique_id' => $site->unique_id
    105         );
     125      if (!isset($res->status)) {
     126        $status = array('upload error');
     127        $backup_name = '';
     128      } else {
     129        $status = $res->status;
     130        $backup_name = $res->backup_name;
     131        if(!empty($res->result))
     132          $result_data = serialize($res->result);
     133      }
    106134
    107         $this->save_report($data);
    108         return $res->status;
     135      $data = array(
     136        'url' => $site->url,
     137        'status' => $status,
     138        'unique_id' => $site->unique_id,
     139        'backup_name' => $backup_name,
     140        'action' => 'upload'
     141      );
     142
     143      if(isset($result_data))
     144        $data['data'] = $result_data;
     145
     146      $this->save_report($data);
     147      $this->save_log_file($data, 'append');
     148      return $status;
    109149    }
    110150
    111151  }
    112152
     153  private function save_report($data)
     154  {
     155    global $wpdb;
     156    $url = $data['url'];
     157    $status = $data['status'] == 'success' ? 1 : serialize($data['status']);
     158    $action = $data['action'];
     159    $backup_name = $data['backup_name'];
    113160
    114     private function save_report($data) {
    115         global $wpdb;
    116         $url = $data['url'];
    117         $status = $data['status'] == 'success' ? 1 : serialize($data['status']);
     161    $unique_id = $data['unique_id'];
     162    $additiona_data = isset($data['data']) ? $data['data'] : NULL;
     163    $time = time();
     164    $date = date('Y-m-d');
    118165
    119         $unique_id = $data['unique_id'];
    120         $time = date( "Y-m-d H-i-s" );
     166    $table_name = $wpdb->prefix . "backup_savvy_reports";
     167    $sql = "INSERT INTO " . $table_name . " (url,action,status,unique_id,backup_name,time,data) VALUES (%s,%s,%s,%s,%s,%s,%s)";
     168    $sql = $wpdb->prepare($sql, $url, $action, $status, $unique_id, $backup_name,$date,$additiona_data);
     169    $wpdb->query($sql);
    121170
    122         $table_name = $wpdb->prefix . "backup_savvy_reports";
    123         $sql = "INSERT INTO ".$table_name." (url,status,unique_id,time) VALUES (%s,%s,%s,%s) ON DUPLICATE KEY UPDATE url=%s, status=%s, time=%s";
    124         $sql = $wpdb->prepare( $sql, $url, $status, $unique_id, $time, $url, $status, $time );
    125         $wpdb->query( $sql );
    126     }
     171  }
     172
     173  private function save_log_file($data, $options = false)
     174  {
     175    if (!file_exists(plugin_dir_path(__DIR__) . '/logs'))
     176      mkdir(plugin_dir_path(__DIR__) . '/logs', 0755);
     177
     178    if (!$options || (isset($options['write']) && $options['write'] == 1))
     179      $write = 'w+';
     180    else
     181      $write = 'a+';
     182
     183    $log = '[' . date('d.m.Y H:i:s') . ']' . "\n";
     184    foreach ($data as $item) {
     185      if (is_array($item))
     186        $log .= print_r($item, 1) . "\n";
     187      else
     188        $log .= $item . "\n";
     189    }
     190    $log .= "\n";
     191
     192    $f = fopen(plugin_dir_path(__DIR__) . '/logs/last-backups.log', $write);
     193    fwrite($f, $log);
     194    fclose($f);
     195  }
    127196}
  • backupsavvy/trunk/inc/BackUpSavvyReports.php

    r1922435 r2236496  
    11<?php
    2 /**
    3  * Created on
    4  * Date: 07.08.2018
    5  * Time: 12:01
    6  */
    72
    8 class backUpSavvyReports {
     3class backUpSavvyReports
     4{
    95
    10   public function __construct() {
     6  public function __construct()
     7  {
     8    add_action('wp_ajax_backupsavvy_log_process', array(&$this, 'log_process'));
    119  }
    1210
    13   public static function get_report() {
     11  public static function get_report($start = false, $per_page = false)
     12  {
    1413    global $wpdb;
    1514
    1615    $table = $wpdb->prefix . "backup_savvy_reports";
    17     $backups = $wpdb->get_results('SELECT * FROM '.$table);
     16    $table_sites = $wpdb->prefix . "backup_savvy_records";
    1817
     18    // get all sites
     19    if ($start !== false && $per_page) {
     20      $sites = $wpdb->get_results('SELECT title,unique_id FROM ' . $table_sites . ' LIMIT ' . $start . ', ' . $per_page);
     21    } else
     22      $sites = $wpdb->get_results('SELECT title,unique_id FROM ' . $table_sites);
     23
     24    $storage = maybe_unserialize(get_option('backupsavvy_storage', false));
     25    $limit = $storage['amount'] ? $storage['amount'] : 2;
     26
     27    foreach ($sites as $site) {
     28      $backups[] = $wpdb->get_results('SELECT * FROM ' . $table . ' WHERE unique_id="' . $site->unique_id . '" and action="upload" ORDER BY ID DESC LIMIT ' . $limit);
     29    }
    1930    return $backups;
    2031  }
     32
     33  public function log_process()
     34  {
     35    check_ajax_referer('set-wpbckup_sets', 'nonce');
     36    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
     37      $this->json_exit(array('status' => 'nonce', 'site' => ''));
     38
     39    $data = array();
     40    parse_str($_POST['data'], $data);
     41
     42    switch ($data['logs']) {
     43      case 'export_csv':
     44        $result = $this->export_csv();
     45        break;
     46      case 'export_txt':
     47        $result = $this->export_txt();
     48        break;
     49      case 'last_backup_log':
     50        $result = $this->get_last_log();
     51        break;
     52      default:
     53        $result = $this->load_php_info();
     54        break;
     55    }
     56
     57
     58    $this->json_exit(array('status' => 'success', 'result' => $result));
     59  }
     60
     61  private function export_csv()
     62  {
     63
     64    return 1;
     65  }
     66
     67  private function export_txt()
     68  {
     69
     70    return 1;
     71  }
     72
     73  private function get_last_log() {
     74    global $wpdb;
     75    $storage = get_option('backupsavvy_storage');
     76
     77    $amount = $storage['amount'];
     78
     79
     80  }
     81
     82  private function load_php_info()
     83  {
     84    ob_start();
     85    phpinfo(INFO_MODULES);
     86    $s = ob_get_contents();
     87    ob_end_clean();
     88    $s = strip_tags($s, '<h2><th><td>');
     89    $s = preg_replace('/<th[^>]*>([^<]+)<\/th>/', '<info>\1</info>', $s);
     90    $s = preg_replace('/<td[^>]*>([^<]+)<\/td>/', '<info>\1</info>', $s);
     91    $t = preg_split('/(<h2[^>]*>[^<]+<\/h2>)/', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
     92    $r = array();
     93    $count = count($t);
     94    $p1 = '<info>([^<]+)<\/info>';
     95    $p2 = '/' . $p1 . '\s*' . $p1 . '\s*' . $p1 . '/';
     96    $p3 = '/' . $p1 . '\s*' . $p1 . '/';
     97    for ($i = 1; $i < $count; $i++) {
     98      if (preg_match('/<h2[^>]*>([^<]+)<\/h2>/', $t[$i], $matchs)) {
     99        $name = trim($matchs[1]);
     100        $vals = explode("\n", $t[$i + 1]);
     101        foreach ($vals AS $val) {
     102          if (preg_match($p2, $val, $matchs)) { // 3cols
     103            $r[$name][trim($matchs[1])] = array(trim($matchs[2]), trim($matchs[3]));
     104          } elseif (preg_match($p3, $val, $matchs)) { // 2cols
     105            $r[$name][trim($matchs[1])] = trim($matchs[2]);
     106          }
     107        }
     108      }
     109    }
     110
     111    $result = '';
     112    foreach ($r as $key => $items) {
     113      $result .= "<h3>$key</h3>";
     114      $table = '';
     115      if (is_array($items)) {
     116        $table = '<table>';
     117        foreach ($items as $key1 => $item) {
     118          if (!is_array($item))
     119            $table .= "<tr><td>$key1</td><td>$item</td></tr>";
     120        }
     121        $table .= "</table>";
     122      }
     123      $result .= $table;
     124    }
     125
     126    return $result;
     127  }
     128
     129  /**
     130   * @param $data array
     131   */
     132  private function json_exit($data)
     133  {
     134    echo json_encode((object)$data);
     135    wp_die();
     136  }
     137
     138
    21139}
  • backupsavvy/trunk/inc/BackUpSavvyScheduler.php

    r1922435 r2236496  
    2424                    'interval'      => 60 * 60 / 30,
    2525                    'event_name'    => 'Create backup',
    26                     'method'        => 'create_backup', // callback funtion
     26                    'method'        => 'create_backup', // callback function
    2727                    'args'          => array()
    2828                )
     
    9797                $this->bcInstance->backup_one($site);
    9898            }
    99 
    100         error_log('create_after_init');
    10199    }
    102100
  • backupsavvy/trunk/inc/BackUpSavvySites.php

    r2065940 r2236496  
    11<?php
    22
    3 class backUpSavvySites {
    4     private $url;
    5     private static $records_table;
    6     private static $report_table;
    7     const per_batch = 1;
    8     protected $apikey;
    9 
    10     public function __construct() {
    11         global $wpdb;
    12 
    13         add_action('wp_ajax_backupsavvy_add_new_site', array(&$this, 'update_site'));
    14 
    15         self::$records_table = $wpdb->prefix . "backup_savvy_records";
    16         self::$report_table = $wpdb->prefix . "backup_savvy_reports";
    17 
    18         // storage process
    19         add_action( 'wp_ajax_backupsavvy_unique_settings', array(&$this, 'set_unique_settings') );
    20         add_action( 'wp_ajax_backupsavvy_set_default', array(&$this, 'set_default_settings') );
    21         add_action( 'wp_ajax_backupsavvy_sync_one', array(&$this, 'sync_one') );
    22         add_action( 'wp_ajax_backupsavvy_sync_process', array(&$this, 'sync_progress') );
    23         add_action( 'wp_ajax_backupsavvy_backup_one', array(&$this, 'backup_one') );
    24         add_action( 'wp_ajax_backupsavvy_upload_one', array(&$this, 'upload_one') );
    25         add_action( 'wp_ajax_backupsavvy_backup_process', array(&$this, 'backup_progress') );
    26         add_action( 'wp_ajax_backupsavvy_save_storage', array(&$this, 'save_storage') );
    27         add_action( 'wp_ajax_backupsavvy_remove_site', array(&$this, 'remove_site') );
    28         add_action( 'wp_ajax_backupsavvy_test_con', array(&$this, 'test_ftp_connection') );
    29         add_action( 'wp_ajax_backupsavvy_premium_update', array(&$this, 'premium_update') );
    30         add_action( 'wp_ajax_backupsavvy_replace_plugin', array(&$this, 'replace_plugin') );
    31 //    add_action( 'admin_action_replace_plugin', array(&$this, 'replace_plugin') );
    32 
    33         $this->apikey = get_option('backupsavvy_apikey', FALSE);
    34 
    35     }
    36 
    37     public function replace_plugin() {
    38     $responseObj = get_option('backupsavvy_premium_object', false);
    39 
    40     if(!$responseObj) {
    41       echo 'Wrong key';
    42       exit;
    43     }
    44 
    45     require_once 'BackUpSavvyUpdates.php';
    46     new backupSavvyUpdates(BACKUPSAVVY_FILE, $responseObj);
    47   }
    48 
    49     public function set_unique_settings() {
    50 
    51     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    52     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     3use altayalp\FtpClient\Servers\FtpServer;
     4use altayalp\FtpClient\FileFactory;
     5
     6class backUpSavvySites
     7{
     8  private $url;
     9  public static $records_table;
     10  public static $report_table;
     11  private $server; // ftp server
     12  const per_batch = 1;
     13  private $unique_id;
     14  protected $apikey;
     15  private $dropbox_settings; // dropbox storage settings
     16  private $google_drive_settings;
     17  private $aws_cloud_settings;
     18
     19  public function __construct()
     20  {
     21    global $wpdb;
     22
     23    add_action('wp_ajax_backupsavvy_add_new_site', array(&$this, 'update_site'));
     24
     25    self::$records_table = $wpdb->prefix . "backup_savvy_records";
     26    self::$report_table = $wpdb->prefix . "backup_savvy_reports";
     27
     28    // storage process
     29    add_action('wp_ajax_backupsavvy_load_sites', array(&$this, 'load_sites'));
     30    add_action('wp_ajax_backupsavvy_filter', array(&$this, 'filter_sites'));
     31    add_action('wp_ajax_backupsavvy_set_default', array(&$this, 'set_default_settings'));
     32    add_action('wp_ajax_backupsavvy_sync_one', array(&$this, 'sync_one'));
     33    add_action('wp_ajax_backupsavvy_sync_process', array(&$this, 'sync_progress'));
     34    add_action('wp_ajax_backupsavvy_backup_one', array(&$this, 'backup_one'));
     35    add_action('wp_ajax_backupsavvy_upload_one', array(&$this, 'upload_one'));
     36    add_action('wp_ajax_backupsavvy_backup_process', array(&$this, 'backup_progress'));
     37    add_action('wp_ajax_backupsavvy_backup_process_op', array(&$this, 'backup_progress_options'));
     38    add_action('wp_ajax_backupsavvy_remove_site', array(&$this, 'remove_site'));
     39    add_action('wp_ajax_backupsavvy_test_con', array(&$this, 'test_ftp_connection'));
     40    add_action('wp_ajax_backupsavvy_download_backup', array(&$this, 'download_backup'));
     41    add_action('wp_ajax_backupsavvy_save_ftp_unique', array(&$this, 'save_ftp_unique'));
     42    add_action('wp_ajax_backupsavvy_save_premium_settings', array(&$this, 'save_premium_settings'));
     43    add_action('wp_ajax_backupsavvy_compare', array(&$this, 'compare'));
     44    add_action('wp_ajax_backupsavvy_count_sites', array(&$this, 'get_num_sites'));
     45    add_action('wp_ajax_backupsavvy_load_report_list', array(&$this, 'load_page_report'));
     46    add_action('wp_ajax_backupsavvy_import_mainwp', array(&$this, 'import_mainwp'));
     47
     48    $this->apikey = get_option('backupsavvy_apikey', FALSE);
     49
     50    if (isset($_GET['backup-file'])) {
     51      $this->download_file($_GET['backup-file']);
     52    }
     53
     54  }
     55
     56
     57  public function import_mainwp() {
     58    check_ajax_referer('set-wpbckup_sets', 'nonce');
     59    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    5360      $this->json_exit(array('status' => 'nonce'));
    5461
    55         $data = array();
    56         parse_str($_POST['data'], $data);
    57 
    58         $data = $this->clean_ftp($data);
    59 
    60         if(!$data) {
    61             $this->json_exit(array('status' => 'fields'));
    62         }
    63 
    64         if(!$_POST['unique'])
    65             $this->json_exit(array('status' => 'unique'));
    66 
    67         $unique_id = trim($_POST['unique']);
    68         $site = self::get_sites($unique_id);
    69         if(!$site)
    70             $this->json_exit(array('status' => 'unique'));
    71 
    72         update_option('backupsavvy_unique_'.$unique_id, $data);
    73 
    74         $storage = $data;
    75 
    76         $this->send_settings($site[0], $storage);
    77 
    78         $this->json_exit(array('status' => 'success'));
    79 
    80     }
    81 
    82     // reset settings to default for individual site
    83     public function set_default_settings() {
    84 
    85     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    86     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     62    $start = $_POST['start'];
     63    $db = new backupSavvyCrud();
     64    $sites = $db->getMainWpSites($start, 5);
     65
     66    if(!empty($sites) && is_array($sites)) {
     67      // write to db and send log
     68      $db->saveMainWp($sites);
     69      $number = count($sites);
     70      if($number == 5)
     71        $next = $number + $start;
     72      else
     73        $next = 'end';
     74
     75      foreach ($sites as $site) {
     76        $info[] = $site->name;
     77      }
     78
     79      $total = self::count_mainwp_sites();
     80
     81      $result = array(
     82        'info' => $info,
     83        'next' => $next,
     84        'total' => $total
     85      );
     86
     87      $this->json_exit($result);
     88    }
     89
     90    $this->json_exit(array('next' => 'none'));
     91  }
     92
     93  public static function count_mainwp_sites()
     94  {
     95    global $wpdb;
     96    $count = $wpdb->get_var("select COUNT(*) from " . $wpdb->prefix."mainwp_wp");
     97
     98    return $count ? $count : 0;
     99  }
     100
     101  // todo: check individual settings when sync progress !!!!!!!!!!!!!!!!!
     102
     103  /**
     104   * compare sites lists
     105   */
     106  public function compare()
     107  {
     108    check_ajax_referer('set-wpbckup_sets', 'nonce');
     109    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    87110      $this->json_exit(array('status' => 'nonce'));
    88111
    89         $storage = get_option('backupsavvy_storage', false);
    90 
    91         if(!$storage)
    92             $this->json_exit(array('status' => 'storage'));
    93 
    94 //      error_log(print_r($_POST,true));
    95 
    96         $data = array();
    97         parse_str($_POST['data'], $data);
    98 
    99         $unique_id = trim($_POST['unique']);
    100         $site = self::get_sites($unique_id);
    101 
    102         if(!$site)
    103             $this->json_exit(array('status' => 'site'));
    104 
    105         delete_option('backupsavvy_unique_'.$unique_id);
    106 
    107         $status = $this->send_settings($site[0]);
    108 
    109         $this->json_exit(array('status' => $status));
    110 
    111     }
    112 
    113     public function test_ftp_connection() {
    114 
    115         $data = array();
    116         parse_str($_POST['data'], $data);
    117 
    118         $data = $this->clean_ftp($data);
    119 
    120         if(!$data) {
    121             $this->json_exit(array('status' => 'fields'));
    122         }
    123 
    124         $status = $this->test_ftp_con($data);
    125 
    126         $this->json_exit(array('status' => $status));
    127     }
    128 
    129     private function test_ftp_con($data) {
    130 
    131         $con = ftp_connect($data['host'], $data['port']) or die("Couldn't connect");
    132         $login = ftp_login($con,  $data['login'],  $data['pass']);
    133 //      error_log(print_r(ftp_nlist($con, "."),true));
    134         if(!ftp_nlist($con, "."))
    135             return 'error';
    136         if(!ftp_chdir($con, $data['dir']))
    137             return 'nodir';
    138         ftp_close($con);
    139 
    140         return 'success';
    141     }
    142 
    143     public function backup_one() {
    144 
    145     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    146     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     112    if (!$_POST['data'])
     113      $this->json_exit(array('status' => 'empty'));
     114
     115    $data = $_POST['data'];
     116    foreach ($data as $key => $item)
     117      $data[$key] = basename(str_replace('www.', '', trim($item)));
     118
     119    $sites = self::get_sites();
     120    if (!$sites)
     121      $this->json_exit(array('status' => 'sites'));
     122
     123    foreach ($sites as $key => $site) {
     124      $parts = parse_url($site->url);
     125      $site_name = $this->clean_domain($parts['host']);
     126      $sites[$key] = $site_name;
     127    }
     128
     129
     130    foreach ($data as $site) {
     131      $site_name = $this->clean_domain($site);
     132      if (!in_array($site_name, $sites))
     133        $result[] = $site_name;
     134    }
     135
     136
     137    $this->json_exit($result);
     138
     139  }
     140
     141  private function clean_domain($url)
     142  {
     143    $site_name = str_replace('www.', '', $url);
     144    $site_name = str_replace('http://', '', $site_name);
     145    $site_name = str_replace('https://', '', $site_name);
     146
     147    return $site_name;
     148  }
     149
     150  public function filter_sites()
     151  {
     152    check_ajax_referer('set-wpbckup_sets', 'nonce');
     153    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
     154      $this->json_exit(array('status' => 'nonce'));
     155
     156    $option = $_POST['option'];
     157
     158    $tr = '';
     159    $name = $_POST['data'] ? trim($_POST['data']) : false;
     160
     161    if ($option == 'sites') {
     162      $sites = $this->get_sites_by_name($name);
     163      $tr = $this->create_table_tr($sites, 1);
     164    }
     165
     166    if ($option == 'report') {
     167      $reports = $this->get_report_by_name($name);
     168      $tr = $reports['tbody'];
     169    }
     170    $result = array(
     171      'sites' => $tr
     172    );
     173
     174    $this->json_exit($result);
     175
     176  }
     177
     178  public function load_sites()
     179  {
     180    check_ajax_referer('set-wpbckup_sets', 'nonce');
     181    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
     182      $this->json_exit(array('status' => 'nonce'));
     183
     184    $number = (int)trim($_POST['number']);
     185    $page = (int)trim($_POST['page']);
     186
     187    $pager = new pagination(new self);
     188    $pager->set_limit($number);
     189    $pager->set_page($page);
     190    $pager->target('?page=backup-savvy-settings');
     191    $pager->set_hash('#list');
     192
     193    $sites_list = $pager->get_sites();
     194
     195    $tr = $this->create_table_tr($sites_list, $page);
     196
     197    $result = array(
     198      'sites' => $tr,
     199      'pager' => $pager->show()
     200    );
     201
     202    $this->json_exit($result);
     203  }
     204
     205  private function create_table_tr($sites_list, $page)
     206  {
     207    $tr = '';
     208    if($sites_list) {
     209      $src = plugin_dir_url(__DIR__) . 'assets/arrow-more.png';
     210      $number = (int)trim($_POST['number']);
     211      foreach ($sites_list as $key => $site) {
     212        $unique_url = '/wp-admin/admin.php?page=backup-savvy-settings&unique=' . $site->unique_id;
     213        $unique_status = '';
     214        if ($site->unique_settings == 1)
     215          $unique_status = '<span class="red"><b>Unique settings</b></span>';
     216
     217        $key_out = ($number*$page - $number) + $key + 1;
     218        $tr .= "<tr>
     219                  <td class='choice'>$key_out <input type='checkbox'>
     220                      <div></div>
     221                  </td>
     222                  <td class='title'>$site->title</td>
     223                  <td class='links'>
     224                      <a href='$unique_url'>$site->url</a>
     225                      <a alt='Unique settings' href='$unique_url'><img src='$src'> </a>
     226                    $unique_status
     227                  </td>
     228                  <td class='action'>
     229                      <a class='backup btn little' href=''>Backup now</a>
     230                      <a class='sync btn little' href=''>Sync</a>
     231                      <a class='remove btn little' href=''>Del</a>
     232                      <div class='spinner little'></div>
     233                      <div class='hidden little' id='$site->unique_id'></div>
     234                  </td>
     235              </tr>";
     236      }
     237    }
     238
     239    return $tr;
     240  }
     241
     242  public function load_page_report() {
     243    check_ajax_referer('set-wpbckup_sets', 'nonce');
     244    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
     245      $this->json_exit(array('status' => 'nonce'));
     246
     247    $number = (int)trim($_POST['number']); // 2
     248    $page = (int)trim($_POST['page']); // 2
     249
     250    // get report table's data
     251    $result = $this->get_report_result($number, $page);
     252
     253    $this->json_exit($result);
     254
     255  }
     256
     257  private function get_report_result($number, $page) {
     258    $pager = new pagination(new BackUpSavvyReports);
     259
     260    $pager->set_limit($number);
     261    $pager->set_page($page);
     262    $pager->target('?page=backup-savvy-settings');
     263    $pager->set_hash('#existing');
     264
     265    $backups =  $pager->get_sites();
     266    $tbody = '';
     267    foreach ($backups as $group) {
     268      if ($group) {
     269        $tbody .= '<tbody class="group">';
     270        foreach ($group as $backup) {
     271          $error = '';
     272          $status = 'backup';
     273          if ($backup->status != 1) {
     274            $status = 'error';
     275            $error = '<span> upload error</span>';
     276          }
     277          $backup_name = isset($backup->backup_name) ? $backup->backup_name : '';
     278          $download_button = " <div class='btn little download' data-id='$backup->id'
     279                                   data-unique='$backup->unique_id'>Download
     280                              </div>";
     281          // todo:: temporary remove download button, not working with the google drive
     282          $download_button = '';
     283          $tbody .= "<tr class='$status'>
     284                          <td>$backup->url $error</td>
     285                          <td>$backup->time</td>
     286                          <td>
     287                              <span>$backup_name</span>
     288                          </td>
     289                          <td class='action'>
     290                             $download_button
     291                              <div class='btn little restore files' data-id='$backup->id' data-unique='$backup->unique_id'>
     292                                Restore
     293                              </div>
     294                          </td>
     295                      </tr>";
     296        }
     297        $tbody .= '</tbody>';
     298      }
     299    }
     300
     301    $result = array(
     302      'tbody' => $tbody,
     303      'pager' => $pager->show()
     304    );
     305
     306    return $result;
     307  }
     308
     309
     310  // reset settings to default for individual site
     311  public function set_default_settings()
     312  {
     313
     314    check_ajax_referer('set-wpbckup_sets', 'nonce');
     315    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
     316      $this->json_exit(array('status' => 'nonce'));
     317
     318    $storage = get_option('backupsavvy_storage', false);
     319
     320    if (!$storage)
     321      $this->json_exit(array('status' => 'storage'));
     322
     323    $unique_id = trim($_POST['unique']);
     324    $site = self::get_sites($unique_id);
     325
     326    if (!$site)
     327      $this->json_exit(array('status' => 'site'));
     328
     329    delete_option('backupsavvy_unique_' . $unique_id);
     330
     331    $this->update_db_unique($site[0]->unique_id, 0);
     332
     333    $status = $this->send_settings($site[0]);
     334
     335    $this->json_exit(array('status' => $status));
     336
     337  }
     338
     339  public function test_ftp_connection()
     340  {
     341
     342    $data = array();
     343    parse_str($_POST['data'], $data);
     344
     345    $data = $this->clean_ftp($data);
     346
     347    if (!$data) {
     348      $this->json_exit(array('status' => 'fields'));
     349    }
     350
     351    $status = $this->test_ftp_con($data);
     352
     353    $this->json_exit(array('status' => $status));
     354  }
     355
     356  public function test_ftp_con($data)
     357  {
     358    if($data['connection'] == 'ftp') {
     359      $con = ftp_connect($data['host'], $data['port']) or die("Couldn't connect");
     360      if(!ftp_login($con, $data['login'], $data['pass'])) {
     361        ftp_close($con);
     362        return 'error';
     363      }
     364
     365      if ($data['mode'] == 'pasv')
     366        ftp_pasv($con, true);
     367
     368      if (!ftp_nlist($con, "."))
     369        return 'error';
     370      if (!ftp_chdir($con, $data['dir']))
     371        return 'nodir';
     372      ftp_close($con);
     373    }
     374    elseif($data['connection'] == 'sftp') {
     375//      error_log(print_r($data,1));
     376      $con = ssh2_connect($data['host'], $data['port']);
     377      $auth_result = ssh2_auth_password($con, $data['login'], $data['pass']);
     378      if(!$auth_result)
     379        return 'error';
     380      $stream = ssh2_exec($con, "cd /home/".$data['dir']. ";ls");
     381      $errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR);
     382      stream_set_blocking($errorStream, true);
     383      stream_set_blocking($stream, true);
     384
     385      $result = stream_get_contents($stream);
     386      $error = stream_get_contents($errorStream);
     387      if(!empty($error))
     388        return $errorStream;
     389
     390      if(empty($result))
     391        return 'nodir';
     392    }
     393    else
     394      return 'error';
     395
     396    return 'success';
     397  }
     398
     399  private function check_access() {
     400      $access = get_option('backupsavvy_premium_object', false);
     401
     402      if(!$access || !is_object($access))
     403          return false;
     404error_log('access '.print_r($access,1));
     405      $postUrl = 'https://backupsavvy.com/wp-json/backupsavvystoreapi/serial';
     406      if($access) {
     407          $access = (array) $access;
     408          $args = array(
     409              'timeout'     => 120, // seconds
     410              'redirection' => 5,
     411              'httpversion' => '1.0',
     412              'blocking'    => true,
     413              'headers'     => array(),
     414              'body'        => $access,
     415              'cookies'     => array(),
     416              'sslverify'   => false
     417          );
     418
     419          $response = wp_remote_post( $postUrl, $args );
     420
     421          if ( is_wp_error( $response ) ) {
     422              $error_message = $response->get_error_message();
     423              return false;
     424          } else {
     425              $res =(object) json_decode($response['body']);
     426              if($res->status == 'ok')
     427                  return true;
     428          }
     429      }
     430
     431      return false;
     432  }
     433
     434  public function backup_one()
     435  {
     436    check_ajax_referer('set-wpbckup_sets', 'nonce');
     437    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    147438      $this->json_exit(array('status' => 'nonce', 'site' => ''));
    148439
    149         $id = $_POST['data'];
    150         $site = self::get_sites(trim($id));
    151         $status = 'no sites to backup';
    152         if(isset($site[0]))
    153             $status = (new backUpSavvyBackup)->backup_one($site[0]);
    154 
    155         $this->json_exit(array('status' => $status, 'url' => $site[0]->url));
    156     }
    157 
    158     public function upload_one() {
    159 
    160     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    161     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     440//    if(!$this->check_access()) // should be another way
     441//        $this->json_exit(array('status' => 'access', 'site' => ''));
     442
     443
     444    //require_once 'BackupSavvyReader.php';
     445    $features = new commonFeatures();
     446
     447    $id = $_POST['data'];
     448    $site = $features->get_site(trim($id));
     449
     450    if(!$site) {
     451        $this->json_exit(array('status' => 'reader', 'url' => ''));
     452    }
     453
     454//    $site = self::get_sites(trim($id));
     455    $status = 'no sites to backup';
     456    if (isset($site[0]))
     457      $status = (new backUpSavvyBackup)->backup_one($site[0]);
     458
     459    $this->json_exit(array('status' => $status, 'url' => $site[0]->url));
     460  }
     461
     462  // todo:: explode download by methods, add other storages
     463  public function download_backup()
     464  {
     465    check_ajax_referer('set-wpbckup_sets', 'nonce');
     466    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    162467      $this->json_exit(array('status' => 'nonce', 'site' => ''));
    163468
    164         $id = $_POST['data'];
    165         $site = self::get_sites(trim($id));
     469    $id = $_POST['id'];
     470    if (empty($id))
     471      $this->json_exit(array('status' => 'id', 'site' => ''));
     472
     473    $this->unique_id = $_POST['unique'];
     474
     475    $storage = self::get_storage($this->unique_id);
     476
     477    $site = self::get_sites($id);
     478    $status = 'success';
     479
     480    if ($storage['connection'] == 'dropbox') {
     481      include_once 'DropboxClient.php';
     482
     483      $token = $storage['token'];
     484      $projectFolder = $storage['folder'];
     485      $secret = $storage['secret'];
     486      $access_key = $storage['access_key'];
     487
     488      $dropbox = new DropboxClient(array(
     489        'app_key' => $access_key,
     490        'app_secret' => $secret,
     491        'app_full_access' => false, // if the app has full or folder only access),
     492        'en'
     493      ));
     494
     495      $dropbox->SetBearerToken(array(
     496        't' => $token,
     497        's' => ''
     498      ));
     499
     500      $file_name = self::get_report_backup_name($id);
     501      if (!$file_name)
     502        $this->json_exit(array('status' => 'name', 'site' => ''));
     503
     504      $backup_list = $dropbox->Search("/", $file_name);
     505
     506      $path = plugin_dir_path(__DIR__);
     507      if(isset($backup_list[0])) {
     508        $dropbox->DownloadFile($backup_list[0], $path . $file_name);
     509      } else {
     510        $status = 'error';
     511      }
     512
     513    }
     514
     515    if ($storage['connection'] == 'ftp') {
     516      $server = $this->get_ftp_server();
     517      $file = FileFactory::build($server);
     518      $file_name = self::get_report_backup_name($id);
     519      $path = plugin_dir_path(__DIR__);
     520      $file->download($storage['dir'] . '/' . $file_name, $path . $file_name);
     521    }
     522
     523    if($storage['connection'] == 'google_drive') {
     524      $storage = self::get_storage($id);
     525      $storage = unserialize($storage['storage']);
     526
     527      $vault = $storage->getStorage('google_drive');
     528      $file_name = self::get_report_backup_name($id);
     529      $data = self::get_report_data($id);
     530      if($data == NULL)
     531        $this->json_exit(array('status' => 'error', 'name' => $file_name, 'code' => 'fileId'));
     532
     533      $data = unserialize($data);
     534      $fileId = $data->fileId;
     535      // download from google_drive
     536      require_once __DIR__ . '/../vendor/autoload.php';
     537      $client = new Google_Client();
     538
     539      $client->addScope(Google_Service_Drive::DRIVE);
     540      $client->setRedirectUri($vault['redirect_uri']);
     541      $client->setAccessToken($vault['token']);
     542
     543      $service = new Google_Service_Drive($client);
     544      $file = $service->files->get($fileId, array( 'alt' => 'media' ));
     545
     546      $downloadUrl = $file->getDownloadUrl();
     547      // todo:: organize download process
     548
     549      $out_dir = get_temp_dir();
     550      if(!is_writable($out_dir))
     551        $out_dir = BACKUPSAVVY_PLUGIN_PATH;
     552
     553    }
     554
     555    $this->json_exit(array('status' => $status, 'name' => $file_name));
     556
     557  }
     558
     559    /**
     560     * update option with new serial key
     561     */
     562  public function save_premium_settings() {
     563      check_ajax_referer('set-wpbckup_sets', 'nonce');
     564      if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
     565          $this->json_exit(array('status' => 'nonce', 'site' => ''));
     566
     567      $data = array();
     568      parse_str($_POST['data'], $data);
     569
     570      if (!$data)
     571          $this->json_exit(array('status' => 'field'));
     572
     573      commonFeatures::updateLicense(array(
     574          'apikey' => trim($data['license'])
     575      ));
     576
     577      $this->json_exit(array('status' => 'success'));
     578  }
     579  /**
     580   * Save ftp for unique site when need to restore it with restore button
     581   */
     582  public function save_ftp_unique() {
     583
     584    check_ajax_referer('set-wpbckup_sets', 'nonce');
     585    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
     586      $this->json_exit(array('status' => 'nonce', 'site' => ''));
     587
     588    if(empty($_POST['unique']) || empty($_POST['data']))
     589      $this->json_exit(array('status' => 'error'));
     590
     591    parse_str($_POST['data'], $data);
     592
     593    $data = $this->clean_ftp($data);
     594    if(!$data)
     595      $this->json_exit(array('status' => 'error'));
     596
     597    $status = $this->test_ftp_con($data);
     598
     599    if ($status != 'success')
     600      $this->json_exit(array('status' => $status));
     601
     602//    error_log('ftp data '.print_r($data,1));
     603    $unique = trim($_POST['unique']);
     604
     605    update_option('backupsavvy_unique_ftp'.$unique, $data);
     606
     607    $this->json_exit(array('status' => 'success'));
     608
     609  }
     610
     611  private function get_ftp_server()
     612  {
     613    $storage = self::get_storage($this->unique_id);
     614
     615    if (!$storage)
     616      return false;
     617
     618    if (!$this->server) {
     619      $server = new FtpServer($storage['host']);
     620      $server->login($storage['login'], $storage['pass']);
     621
     622      if (empty($storage['active'])) {
     623        $server->turnPassive();
     624      }
     625
     626      $this->server = $server;
     627    }
     628
     629    return $this->server;
     630  }
     631
     632  /**
     633   * 'backupsavvy_unique_' . $id - unique storage settings for site, if it has special settings
     634   * 'backupsavvy_storage' - common storage
     635   * 'backupsavvy_unique_ftp'.$unique - unique ftp settings if site need to restore. FTP must exists in this case
     636   *
     637   * @param bool $id
     638   * @return array|mixed|void
     639   */
     640  public static function get_storage($id = false)
     641  {
     642    if(!empty($_GET['unique']))
     643      $id = trim($_GET['unique']);
     644
     645    $storage = array();
     646
     647    if ($id)
     648      $storage = get_option('backupsavvy_unique_' . $id, array());
     649
     650    if (!$storage)
     651      $storage = get_option('backupsavvy_storage', array());
     652
     653    return $storage;
     654  }
     655
     656  public function upload_one()
     657  {
     658
     659    check_ajax_referer('set-wpbckup_sets', 'nonce');
     660    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
     661      $this->json_exit(array('status' => 'nonce', 'site' => ''));
     662
     663    $id = $_POST['data'];
     664    $site = self::get_sites(trim($id));
    166665    $status = 'no sites to upload';
    167         if(isset($site[0]))
    168             $status = (new backUpSavvyBackup)->upload_one($site[0]);
    169 
    170         $this->json_exit(array('status' => $status, 'site' => $site[0]->title));
    171     }
    172 
    173     public function sync_one() {
    174 
    175     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    176     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     666    if (isset($site[0]))
     667      $status = (new backUpSavvyBackup)->upload_one($site[0]);
     668
     669    if ($status != 'success')
     670      $status = 'error';
     671
     672    $exit = array('status' => $status, 'site' => $site[0]->title);
     673
     674    $this->json_exit($exit);
     675  }
     676
     677  public function sync_one()
     678  {
     679
     680    check_ajax_referer('set-wpbckup_sets', 'nonce');
     681    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    177682      $this->json_exit(array('status' => 'nonce'));
    178683
    179         $id = $_POST['id'];
    180         $site = self::get_sites(trim($id));
    181         $status = 'error';
    182         if($site)
    183             $status = $this->send_settings($site[0]);
    184 
    185         $this->json_exit(array('status' => $status));
    186     }
    187 
    188     public function sync_progress() {
    189 
    190     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    191     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     684    $id = $_POST['id'];
     685    $site = self::get_sites(trim($id));
     686    $status = 'error';
     687
     688    if ($site)
     689      $status = $this->send_settings($site[0]);
     690
     691    $this->json_exit(array('status' => $status, 'site' => $site[0]->title));
     692  }
     693
     694  public function sync_progress()
     695  {
     696
     697    check_ajax_referer('set-wpbckup_sets', 'nonce');
     698    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    192699      $this->json_exit(array('status' => 'nonce'));
    193700
    194         ignore_user_abort( TRUE );
    195 
    196         if ( ! ini_get( 'safe_mode' ) ) {
    197             @set_time_limit( 0 );
    198         }
    199 
    200         $step    = isset( $_POST['step'] ) ? absint( $_POST['step'] ) : 1;
     701    ignore_user_abort(TRUE);
     702
     703    if (!ini_get('safe_mode')) {
     704      @set_time_limit(0);
     705    }
     706
     707    $license = get_option('backupsavvy_license', FALSE);
     708
     709    $step = isset($_POST['step']) ? absint($_POST['step']) : 1;
    201710//      $total   = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : FALSE;
    202         $start = $step == 1 ? 0 : ($step-1)*1;
    203 
    204         // get all sites
    205         $sites = self::get_sites(false, $start, 1);
    206         $current_site = '';
    207         if($sites)
    208             foreach ( $sites as $site ) {
    209                 $current_site = $site->title;
    210                 // sync settings
    211                 try {
    212                     $this->send_settings($site);
    213                 } catch (Exception $e) {
    214                     throw new Exception($e->getMessage());
    215                 }
    216             }
    217 
    218         $step++;
    219 
    220         $total = self::count_sites();
    221         if($step >= $total || !$total)
    222             $total = 'completed';
    223 
    224         $this->json_exit( array( 'step'  => $step,
    225                                  'total' => $total,
    226                                  'site'  => $current_site,
    227                              'status' => 'success'
    228         ) );
    229 
    230     }
    231 
    232     private function clean_ftp($data) {
    233         if(!is_array($data))
    234             return false;
    235 
    236         if(!$data['host'] || !$data['pass'] || !$data['login'] || !$data['dir'] || !$data['port'])
    237             return false;
    238 
    239         if(!is_numeric($data['port']))
    240             return false;
    241 
    242         $data['host'] = untrailingslashit( sanitize_text_field($data['host']) );
    243         $data['login'] = sanitize_text_field($data['login']);
    244         $data['dir'] = untrailingslashit ( sanitize_text_field($data['dir']) );
    245         $data['port'] = (int) $data['port'];
    246 
    247         if ( isset( $data['exclude_d'] ) ) {
    248             $data['exclude_d'] = explode( ',', trim($data['exclude_d']) );
    249         }
    250 
    251         if(isset($data['exclude_f'])) {
    252             $data['exclude_f'] = explode( ',', trim($data['exclude_f']) );
    253         }
    254 
    255         return $data;
    256     }
    257 
    258     public function save_storage() {
    259 
    260     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    261     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
    262       $this->json_exit(array('status' => 'nonce'));
    263 
    264         $data = array();
    265         parse_str($_POST['data'], $data);
    266 
    267         $status = $this->test_ftp_con($data);
    268 
    269         if(!$data)
    270             $this->json_exit(array('status' => 'field'));
    271 
    272         if($status != 'success')
    273             $this->json_exit(array('status' => $status));
    274 
    275         $data = $this->clean_ftp($data);
    276 
    277 //      error_log(print_r($data, true));
    278 
    279         update_option('backupsavvy_storage', $data);
    280 
    281         $this->json_exit(array('status' => $status));
    282     }
    283 
    284     /**
    285      * @param $data array
    286      */
    287     private function json_exit($data) {
    288         echo json_encode((object) $data);
    289         wp_die();
    290     }
    291 
    292     private function send_settings($site, $storage = false) {
    293 
    294         if(!$storage)
    295             $storage = get_option('backupsavvy_storage', false);
    296 
    297         if(!$storage)
    298             return 'error';
    299 
    300     $postUrl = $site->url.'/wp-json/backupsavvyapi/settings';
     711    $start = $step == 1 ? 0 : ($step - 1) * 1;
     712
     713    // get all sites
     714    $sites = self::get_sites(false, $start, 1);
     715    $current_site = '';
     716    if ($sites)
     717      foreach ($sites as $site) {
     718        $current_site = $site->title;
     719        if ($site->unique_settings != 1) {
     720          // sync settings
     721          try {
     722            $this->send_settings($site);
     723          } catch (Exception $e) {
     724            throw new Exception($e->getMessage());
     725          }
     726          $status = 'success';
     727        } else {
     728          $status = 'unique';
     729        }
     730      }
     731    else
     732      $status = 'empty';
     733
     734    $step++;
     735
     736    $count = self::count_sites();
     737    $total = $count;
     738
     739    if ($step > $count || empty($count)) {
     740      $total = 'completed';
     741    }
     742
     743    $this->json_exit(array(
     744      'step' => $step,
     745      'total' => $total,
     746      'site' => $current_site,
     747      'status' => $status,
     748      'count' => $count,
     749    ));
     750  }
     751
     752  public function clean_ftp($data)
     753  {
     754    if (!is_array($data))
     755      return false;
     756
     757    if (!$data['host'] || !$data['pass'] || !$data['login'] || !$data['dir'] || !$data['port'])
     758      return false;
     759
     760    if (!is_numeric($data['port']))
     761      return false;
     762
     763    $data['host'] = untrailingslashit(sanitize_text_field($data['host']));
     764    $data['login'] = sanitize_text_field($data['login']);
     765    $data['dir'] = untrailingslashit(sanitize_text_field($data['dir']));
     766    $data['port'] = (int)$data['port'];
     767
     768    if (isset($data['exclude_d'])) {
     769      $data['exclude_d'] = explode(',', trim($data['exclude_d']));
     770    }
     771
     772    if (isset($data['exclude_f'])) {
     773      $data['exclude_f'] = explode(',', trim($data['exclude_f']));
     774    }
     775
     776    return $data;
     777  }
     778
     779
     780  /**
     781   * @param $data array
     782   */
     783  private function json_exit($data)
     784  {
     785    echo json_encode((object)$data);
     786    wp_die();
     787  }
     788
     789  public function send_settings($site, $storage = false)
     790  {
     791
     792    $storage = self::get_storage($site->unique_id);
     793
     794    if (!$storage)
     795      return 'error';
     796
     797    $protection = md5($site->protection.'.bcssvy');
     798
     799    $postUrl = $site->url . '/wp-json/backupsavvyapi/settings';
    301800    $args = array(
    302       'timeout'     => 120, // seconds
     801      'timeout' => 120, // seconds
    303802      'redirection' => 5,
    304803      'httpversion' => '1.0',
    305       'blocking'    => true,
    306       'headers'     => array(),
    307       'body'        => array(
     804      'blocking' => true,
     805      'headers' => array(),
     806      'body' => array(
    308807        'apikey' => $this->apikey,
    309         'secret' => $site->protection,
     808        'secret' => $protection,
    310809        'action' => 'storage',
    311810        'data' => $storage
    312811      ),
    313       'cookies'     => array(),
    314       'sslverify'   => false
     812      'cookies' => array(),
     813      'sslverify' => false
    315814    );
    316815
    317     $response = wp_remote_post( $postUrl, $args );
    318 
    319     if ( is_wp_error( $response ) ) {
     816    $response = wp_remote_post($postUrl, $args);
     817
     818    if (is_wp_error($response)) {
    320819      $error_message = $response->get_error_message();
    321820      return $error_message;
    322821    } else {
    323       $res =(object) json_decode($response['body']);
    324     }
    325 
    326         return $res->status;
    327     }
    328 
    329   public function premium_update() {
    330 
    331     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    332     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     822      $res = (object)json_decode($response['body']);
     823      if(!isset($res->status))
     824        return 'error';
     825    }
     826
     827
     828    return $res->status;
     829  }
     830
     831
     832  public function update_site()
     833  {
     834    global $wpdb;
     835
     836    check_ajax_referer('set-wpbckup_sets', 'nonce');
     837    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    333838      $this->json_exit(array('status' => 'nonce'));
    334839
    335     $apikey = $_POST['data'];
    336 
    337     if($_SERVER['HTTP_HOST'])
    338       $domain = $_SERVER['HTTP_HOST'];
    339     else if($_SERVER['SERVER_NAME'])
    340       $domain = $_SERVER['HTTP_HOST'];
     840    $data = array();
     841    parse_str($_POST['data'], $data);
     842
     843    $secret = trim($data['code']);
     844    $protection = md5($secret.'.bcssvy');
     845    $this->url = untrailingslashit(esc_url_raw($data['url']));
     846
     847    $status = 'error_exists';
     848    if (!$this->site_exists($this->url)) {
     849      $status = 'error_protecion';
     850      $unique_id = $this->check_child_protection($protection);
     851      if ($unique_id) {
     852        $status = 'error';
     853
     854        $title = sanitize_text_field($data['title']);
     855        $url = $this->url;
     856        $time = date("Y-m-d");
     857        $acitvated = 1;
     858
     859        $sql = "INSERT INTO " . self::$records_table . " (title,activated,url,protection,unique_id,time) VALUES (%s,%d,%s,%s,%s,%s) ON DUPLICATE KEY UPDATE title=%s, activated=%d, url=%s";
     860        $sql = $wpdb->prepare($sql, $title, $acitvated, $url, $secret, $unique_id, $time, $title, $acitvated, $url);
     861        if ($wpdb->query($sql)) {
     862          $status = 'success';
     863        }
     864      }
     865    }
     866
     867    $this->json_exit(array('status' => $status));
     868  }
     869
     870  /**
     871   * update db unique_settings col
     872   * @param $unique_id
     873   * @param $action
     874   * @return string
     875   */
     876  public function update_db_unique($unique_id, $action)
     877  {
     878    global $wpdb;
     879    $status = 'error';
     880    $sql = "UPDATE " . self::$records_table . " SET unique_settings=%s WHERE unique_id=%s";
     881    $sql = $wpdb->prepare($sql, $action, $unique_id);
     882    $query = $wpdb->query($sql);
     883
     884    if ($query) {
     885      $status = 'success';
     886    }
     887
     888    return $status;
     889  }
     890
     891  private function site_exists($url)
     892  {
     893    global $wpdb;
     894
     895    $sql = $wpdb->get_results('SELECT unique_id FROM ' . self::$records_table . ' WHERE url="' . $url . '"');
     896
     897    if (empty($sql)) {
     898      return false;
     899    }
     900
     901    return true;
     902  }
     903
     904  public static function get_sites($id = FALSE, $start = false, $limit = false, $pager = false)
     905  {
     906    global $wpdb;
     907
     908    $sites = (new commonFeatures())->get_sites($id, $start, $limit, $pager);
     909//      if($pager && isset($_GET['num'])) {
     910//          $page = (int) trim($_GET['num']);
     911//          $start = !$page ? 0 : $limit * $page;
     912//        }
     913
     914    return $sites;
     915  }
     916
     917  private function get_sites_by_name($name)
     918  {
     919    global $wpdb;
     920
     921    if(!$name)
     922      $sites = $wpdb->get_results("SELECT * FROM " . self::$records_table);
    341923    else
    342       $domain = '';
    343 
    344     if(!$apikey)
    345       $this->json_exit(array('status' => 'apikey'));
    346 
    347     $postUrl = 'https://backupsavvy.com/wp-json/backupsavvystoreapi/serial';
    348     $args = array(
    349       'timeout'     => 120, // seconds
    350       'redirection' => 5,
    351       'httpversion' => '1.0',
    352       'blocking'    => true,
    353       'headers'     => array(),
    354       'body'        => array(
    355         'apikey' => $apikey,
    356         'plugin_key' => 'cleanD8iunjdASDFlk77465lk',
    357         'domain_name' => $domain
    358       ),
    359       'cookies'     => array(),
    360       'sslverify'   => false
    361     );
    362 
    363     $response = wp_remote_post( $postUrl, $args );
    364 
    365     if ( is_wp_error( $response ) ) {
    366       $error_message = $response->get_error_message();
    367       $this->json_exit(array('status' => $error_message));
    368       exit;
    369     } else {
    370       $res =(object) json_decode($response['body']);
    371     }
    372 
    373     if(isset($res->status) && $res->status != 'ok')
    374       $this->json_exit(array('status' => $res->status));
    375 
    376 //    error_log(print_r($res,1));
    377     $responseObj = json_decode(base64_decode($res->response));
    378 
    379     include_once 'BackUpSavvyUpdates.php';
    380     include_once 'BackupSavvyReadmeParser.php';
    381 
    382     update_option('backupsavvy_premium_object', $responseObj);
    383 
    384     $this->json_exit(array('status' => 'ok'));
    385 
    386   }
    387 
    388 
    389     public function update_site() {
    390         global $wpdb;
    391 
    392     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    393     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     924      $sites = $wpdb->get_results("SELECT * FROM " . self::$records_table . " WHERE url LIKE '%" . $name . "%'");
     925
     926    return $sites;
     927  }
     928
     929  private function get_report_by_name($name)
     930  {
     931    global $wpdb;
     932
     933    $storage = self::get_storage();
     934    $limit = $storage['amount'];
     935    if(!$name) {
     936      $result = $this->get_report_result(99999999, 1);
     937    }
     938    else {
     939      $site = $wpdb->get_results('SELECT title,unique_id FROM ' . self::$records_table . ' WHERE url LIKE "%' . $name . '%"');
     940
     941      foreach ($site as $rep) {
     942        $backups[] = $wpdb->get_results('SELECT * FROM ' . self::$report_table . ' WHERE unique_id="' . $rep->unique_id . '" and action="upload" ORDER BY ID DESC LIMIT ' . $limit);
     943      }
     944
     945      $tbody = "";
     946      foreach ($backups as $group) {
     947        if ($group) {
     948          $tbody .= '<tbody class="group">';
     949          foreach ($group as $backup) {
     950            $error = '';
     951            $status = 'backup';
     952            if ($backup->status != 1) {
     953              $status = 'error';
     954              $error = '<span> upload error</span>';
     955            }
     956            $backup_name = isset($backup->backup_name) ? $backup->backup_name : '';
     957            $download_button = '<div class=\'btn little\' data-id=\'$backup->id\'
     958                                   data-unique=\'$backup->unique_id\'>Download
     959                              </div>';
     960            $tbody .= "<tr class='$status'>
     961                          <td>$backup->url $error</td>
     962                          <td>$backup->time</td>
     963                          <td>
     964                              <span>$backup_name</span>
     965                          </td>
     966                          <td class='action'>
     967                              $download_button
     968                              <div class='btn little restore db' data-id='$backup->id' data-unique='$backup->unique_id'>
     969                                Restore db
     970                              </div>
     971                          </td>
     972                      </tr>";
     973          }
     974          $tbody .= '</tbody>';
     975        }
     976      }
     977
     978      $result['tbody'] = $tbody;
     979    }
     980
     981    return $result;
     982  }
     983
     984  public static function get_iterat_sites()
     985  {
     986    global $wpdb;
     987    $exclude = array();
     988    $sites = $wpdb->get_results("SELECT unique_id FROM " . self::$report_table . " WHERE status <> 1");
     989
     990    if (!$sites)
     991      return false;
     992
     993    foreach ($sites as $site) {
     994      $exclude[] = "'$site->unique_id'";
     995    }
     996
     997    $exclude_sql = implode(', ', $exclude);
     998
     999    $sites = $wpdb->get_results("SELECT * FROM " . self::$records_table . " WHERE unique_id IN (" . $exclude_sql . ")");
     1000
     1001    return $sites;
     1002  }
     1003
     1004  public static function get_report_backup_name($id)
     1005  {
     1006    global $wpdb;
     1007    $site = $wpdb->get_results("SELECT backup_name FROM " . self::$report_table . " WHERE id = '" . $id . "'");
     1008
     1009    if (!$site)
     1010      return false;
     1011
     1012    return $site[0]->backup_name;
     1013  }
     1014
     1015  public static function get_report_data($id)
     1016  {
     1017    global $wpdb;
     1018    $site = $wpdb->get_results("SELECT data FROM " . self::$report_table . " WHERE id = '" . $id . "'");
     1019
     1020    if (!$site)
     1021      return false;
     1022
     1023    return $site[0]->data;
     1024  }
     1025
     1026  public static function count_sites()
     1027  {
     1028    global $wpdb;
     1029    $count = $wpdb->get_var("select COUNT(*) from " . self::$records_table);
     1030
     1031    return $count ? $count : 0;
     1032  }
     1033
     1034  public function get_num_sites()
     1035  {
     1036    check_ajax_referer('set-wpbckup_sets', 'nonce');
     1037    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    3941038      $this->json_exit(array('status' => 'nonce'));
    3951039
    396         $data = array();
    397         parse_str($_POST['data'], $data);
    398 
    399         $protection = trim($data['code']);
    400         $this->url = untrailingslashit( esc_url_raw($data['url']) );
    401         $status = 'error_exists';
    402         if(!$this->site_exists($this->url)) {
    403             $status = 'error_protecion';
    404             $unique_id = $this->check_child_protection( $protection );
    405             if ( $unique_id ) {
    406                 $status = 'error';
    407 
    408                 $title     = sanitize_text_field( $data['title'] );
    409                 $url       = $this->url;
    410                 $time      = date( "Y-m-d" );
    411                 $acitvated = 1;
    412 
    413                 $sql = "INSERT INTO " . self::$records_table . " (title,activated,url,protection,unique_id,time) VALUES (%s,%d,%s,%s,%s,%s) ON DUPLICATE KEY UPDATE title=%s, activated=%d, url=%s";
    414                 $sql = $wpdb->prepare( $sql, $title, $acitvated, $url, $protection, $unique_id, $time, $title, $acitvated, $url );
    415                 if ( $wpdb->query( $sql ) ) {
    416                     $status = 'success';
    417                 }
    418             }
    419         }
    420 
    421         $this->json_exit(array('status' => $status));
    422     }
    423 
    424     private function site_exists($url) {
    425         global $wpdb;
    426 
    427         $sql = $wpdb->get_results('SELECT unique_id FROM '.self::$records_table . ' WHERE url="'. $url.'"');
    428 
    429         if ( empty($sql)) {
    430             return false;
    431         }
    432 
    433         return true;
    434     }
    435 
    436     public static function get_sites($id = FALSE, $start = false, $limit = false) {
    437         global $wpdb;
    438         if(!$id) {
    439             if ( $start || $start === 0 ) {
    440                 $sites = $wpdb->get_results( "SELECT *  FROM " . self::$records_table . " LIMIT " . $start . ", " . $limit );
    441             } else {
    442                 $sites = $wpdb->get_results( "SELECT * FROM " . self::$records_table . " ORDER BY id DESC" );
    443             }
    444         }
    445         else {
    446             $sites = $wpdb->get_results( "SELECT title,url,protection,activated,unique_id  FROM " . self::$records_table . " WHERE unique_id='" . $id ."'");
    447         }
    448 
    449         return $sites;
    450     }
    451 
    452     public static function get_iterat_sites() {
    453         global $wpdb;
    454         $exclude = array();
    455         $sites = $wpdb->get_results( "SELECT unique_id FROM " . self::$report_table . " WHERE status <> 1" );
    456 
    457         if(!$sites)
    458             return false;
    459 
    460         foreach ( $sites as $site ) {
    461             $exclude[] = "'$site->unique_id'";
    462         }
    463 
    464         $exclude_sql = implode(', ', $exclude);
    465 
    466         $sites = $wpdb->get_results( "SELECT * FROM " . self::$records_table . " WHERE unique_id IN (".$exclude_sql.")");
    467 
    468         return $sites;
    469     }
    470 
    471     public static function count_sites() {
    472         global $wpdb;
    473 
    474         return $wpdb->get_var("select COUNT(*) from ".self::$records_table);
    475     }
    476 
    477     public function remove_site() {
    478         global $wpdb;
    479 
    480     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    481     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     1040    $number = array('number' => self::count_sites());
     1041
     1042    $this->json_exit($number);
     1043  }
     1044
     1045  public function remove_site()
     1046  {
     1047    global $wpdb;
     1048
     1049    check_ajax_referer('set-wpbckup_sets', 'nonce');
     1050    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    4821051      $this->json_exit(array('status' => 'nonce'));
    4831052
    484         $status = 'success';
    485         $id = $_POST['id'];
    486 
    487         if(!$id)
    488             $status = 'error';
    489         else
    490             $wpdb->delete(self::$records_table, array('unique_id' => $id));
    491 
    492         $this->json_exit(array('status' => $status));
    493 
    494     }
    495 
    496     public function backup_progress() {
    497         // start balk operations
    498 
    499     check_ajax_referer( 'set-wpbckup_sets', 'nonce' );
    500     if( ! wp_verify_nonce( $_POST['nonce'], 'set-wpbckup_sets' ) )
     1053    $status = 'success';
     1054    $id = $_POST['id'];
     1055
     1056    if (!$id)
     1057      $status = 'error';
     1058    else {
     1059      delete_option('backupsavvy_unique_' . $id);
     1060      $wpdb->delete(self::$records_table, array('unique_id' => $id));
     1061    }
     1062
     1063    $this->json_exit(array('status' => $status));
     1064
     1065  }
     1066
     1067  public function backup_progress()
     1068  {
     1069    // start balk operations
     1070    check_ajax_referer('set-wpbckup_sets', 'nonce');
     1071    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
    5011072      $this->json_exit(array('status' => 'nonce', 'site' => ''));
    5021073
    503         ignore_user_abort( TRUE );
    504 
    505         if ( ! ini_get( 'safe_mode' ) ) {
    506             @set_time_limit( 0 );
    507         }
    508 
    509         $step    = isset( $_POST['step'] ) ? absint( $_POST['step'] ) : 1;
    510         $start = ($step == 1 || $step == 0)? 0 : ($step-1)*1;
     1074    ignore_user_abort(TRUE);
     1075
     1076    if (!ini_get('safe_mode')) {
     1077      @set_time_limit(0);
     1078    }
     1079
     1080    // create log file
     1081    if(!file_exists(plugin_dir_path(__DIR__).'/logs'));
     1082      mkdir(plugin_dir_path(__DIR__).'/logs', '0755');
     1083
     1084    $step = isset($_POST['step']) ? absint($_POST['step']) : 1;
     1085    $start = ($step == 1 || $step == 0) ? 0 : ($step - 1) * 1;
     1086
     1087    if($start == 0) {
     1088      if(file_exists(plugin_dir_path(__DIR__).'/logs/backup-all.log'))
     1089        unlink(plugin_dir_path(__DIR__).'/logs/backup-all.log');
     1090    }
     1091
    5111092//      error_log($start . ' '.self::per_batch);
    512         // get all sites
    513         $site = self::get_sites(false, $start, 1);
    514         $site = $site[0];
     1093    // get all sites
     1094    $site = self::get_sites(false, $start, 1);
     1095    $site = $site[0];
    5151096
    5161097//      error_log($step . print_r($sites,true));
    5171098
    518         $curent_site = $status = '';
    519         if($site) {
     1099    $curent_site = $status = '';
     1100    if ($site) {
    5201101      $curent_site = $site->title;
    5211102      try {
     
    5261107    }
    5271108
    528         $step++;
    529         //$step = 8; // temp
    530         $total = self::count_sites();
    531         if($step >= $total || !$total) $status = 'completed';
    532 
    533     $this->json_exit(array('step'   => $step,
    534                           'total'  => $total,
    535                           'site'   => $curent_site,
    536                           'status' => $status,
    537                           'id'     => $site->unique_id
     1109    $step++;
     1110    $total = self::count_sites();
     1111    $completed = 'no';
     1112    if ($step > $total || !$total) $completed = 'completed';
     1113
     1114    $this->json_exit(array('step' => $step,
     1115      'total' => $total,
     1116      'site' => $curent_site,
     1117      'status' => $status,
     1118      'id' => $site->unique_id,
     1119      'completed' => $completed
    5381120    ));
    5391121  }
    5401122
    541   private function check_child_protection($protection_code) {
    542         // realization of the curl request to child site and compare the code
    543 
    544         $postUrl = $this->url.'/wp-json/backupsavvyapi/addsite';
    545         $unique = $this->get_unique($this->url);
     1123  public function backup_progress_options()
     1124  {
     1125    check_ajax_referer('set-wpbckup_sets', 'nonce');
     1126    if (!wp_verify_nonce($_POST['nonce'], 'set-wpbckup_sets'))
     1127      $this->json_exit(array('status' => 'nonce', 'site' => ''));
     1128
     1129    ignore_user_abort(TRUE);
     1130
     1131    if (!ini_get('safe_mode')) {
     1132      @set_time_limit(0);
     1133    }
     1134
     1135  }
     1136
     1137  private function check_child_protection($protection_code)
     1138  {
     1139    // realization of the curl request to child site and compare the code
     1140
     1141    $postUrl = $this->url . '/wp-json/backupsavvyapi/addsite';
    5461142
    5471143    $args = array(
    548       'timeout'     => 45, // seconds
     1144      'timeout' => 45, // seconds
    5491145      'redirection' => 5,
    5501146      'httpversion' => '1.0',
    551       'blocking'    => true,
    552       'headers'     => array(),
    553       'body'        => array(
     1147      'blocking' => true,
     1148      'headers' => array(),
     1149      'body' => array(
    5541150        'apikey' => $this->apikey,
    555         'secret' => $protection_code,
    556         'unique' => $unique // for tests
     1151        'secret' => $protection_code
    5571152      ),
    558       'cookies'     => array(),
    559       'sslverify'   => false
     1153      'cookies' => array(),
     1154      'sslverify' => false
    5601155    );
    5611156
    562     $response = wp_remote_post( $postUrl, $args );
    563 
    564     if ( is_wp_error( $response ) ) {
     1157    $response = wp_remote_post($postUrl, $args);
     1158
     1159    if (is_wp_error($response)) {
    5651160      $error_message = $response->get_error_message();
    5661161      error_log($error_message);
    5671162      return false;
    5681163    } else {
    569       $res =(object) json_decode($response['body']);
    570       if($res->status != 'success')
     1164      $res = (object)json_decode($response['body']);
     1165      if ($res->status != 'success')
    5711166        return false;
    5721167    }
    5731168
    574         return $unique;
    575     }
    576 
    577     // generate unique
    578     public function get_unique($input, $len = 7) {
    579         $hex = md5($input);
    580 
    581         $pack = pack('H*', $hex);
    582         $tmp =  base64_encode($pack);
    583 
    584         $uid = preg_replace("#(*UTF8)[^A-Za-z0-9]#", "", $tmp);
    585 
    586         $len = max(4, min(128, $len));
    587 
    588         while (strlen($uid) < $len)
    589             $uid .= $this->get_unique(22);
    590 
    591         return substr($uid, 0, $len);
    592     }
    593 
    594     public static function get_site_unique() {
    595 
    596         return false;
    597     }
    598 
    599     public static function get_current_url() {
    600 
    601         $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    602         $escaped_url = htmlspecialchars( $url, ENT_QUOTES, 'UTF-8' );
    603 
    604         return $escaped_url;
    605     }
    606 
    607     public static function backupsavvy_parse_current_url() {
    608 
    609         $url = self::get_current_url();
    610 
    611         $url = wp_parse_url($url);
    612 
    613         parse_str(html_entity_decode($url['query']), $url['query']);
    614 
    615         return $url;
    616     }
     1169    $unique_id = self::get_unique($protection_code);
     1170
     1171    return $unique_id;
     1172//    return $protection_code;
     1173  }
     1174
     1175  // generate unique
     1176  public static function get_unique($input, $len = 7)
     1177  {
     1178    $time = round(microtime(true) * 1000);
     1179    $hex = md5($input . $time);
     1180
     1181    $pack = pack('H*', $hex);
     1182    $tmp = base64_encode($pack);
     1183
     1184    $uid = preg_replace("#(*UTF8)[^A-Za-z0-9]#", "", $tmp);
     1185
     1186    $len = max(4, min(128, $len));
     1187
     1188    while (strlen($uid) < $len)
     1189      $uid .= self::get_unique(22);
     1190
     1191    return substr($uid, 0, $len);
     1192  }
     1193
     1194  public static function get_current_url()
     1195  {
     1196
     1197    $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
     1198    $escaped_url = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
     1199
     1200    return $escaped_url;
     1201  }
     1202
     1203  public static function backupsavvy_parse_current_url()
     1204  {
     1205
     1206    $url = self::get_current_url();
     1207
     1208    $url = wp_parse_url($url);
     1209
     1210    parse_str(html_entity_decode($url['query']), $url['query']);
     1211
     1212    return $url;
     1213  }
     1214
     1215  private function download_file($file_name)
     1216  {
     1217
     1218//    $file_path = plugin_dir_path(__DIR__);
     1219    $file_path = get_temp_dir();
     1220    if(!is_writable($file_path))
     1221      $file_path = BACKUPSAVVY_PLUGIN_PATH;
     1222
     1223    $path = $file_path . "/" . $file_name;
     1224
     1225
     1226    header('Cache-Control: no-store, no-cache, must-revalidate');
     1227    header('Cache-Control: pre-check=0, post-check=0, max-age=0', false);
     1228    header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     1229    $browser = $_SERVER['HTTP_USER_AGENT'];
     1230
     1231    header('Content-Description: File Transfer');
     1232    header('Content-Transfer-Encoding: zip');
     1233    header('Content-Disposition: attachment; filename=' . $file_name);
     1234    header('Content-Transfer-Encoding: binary');
     1235    header('Expires: 0');
     1236    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
     1237    header('Pragma: public');
     1238    header('Content-Length: ' . filesize($path));
     1239
     1240    header('Content-Type: application/zip');
     1241
     1242    ob_clean();
     1243    flush();
     1244    readfile($path);
     1245//        unlink($file);
     1246    return;
     1247
     1248//        if ($file = fopen($path, 'rb'))
     1249//        {
     1250//            while(!feof($file) and (connection_status()==0))
     1251//            {
     1252//                print(fread($file, filesize($path)));
     1253//                flush();
     1254//            }
     1255//            fclose($file);
     1256//        }
     1257  }
    6171258
    6181259}
     1260
     1261if (!class_exists('storageSettings', false)) {
     1262  class storageSettings
     1263  {
     1264    private $name;
     1265    private $vaults = [];
     1266
     1267    public function __construct($name, array $args)
     1268    {
     1269      $this->name = $name;
     1270      $args['name'] = $name;
     1271      $this->vaults[$name] = $args;
     1272    }
     1273
     1274    public function getStorage($name)
     1275    {
     1276      return !empty($this->vaults[$name]) ? $this->vaults[$name] : false;
     1277    }
     1278
     1279    /**
     1280     * @param storageSettings $storage current storage
     1281     * @param storageSettings $new_storage new storage to add it
     1282     * @return storageSettings $storage
     1283     */
     1284    public function addStorage(storageSettings $storage, $new_storage)
     1285    {
     1286
     1287      $storage->vaults[$this->name] = $new_storage->getStorage($this->name); // array
     1288
     1289      return $storage;
     1290
     1291    }
     1292
     1293    // will be removed storage from the saved storage object
     1294    public function cleanStorage()
     1295    {
     1296
     1297    }
     1298
     1299  }
     1300}
  • backupsavvy/trunk/parts/existing-backups.php

    r1922435 r2236496  
    11<?php
    2   // get report table's data
    3   $backups = BackUpSavvyReports::get_report();
     2// creating license process:
     3// 1. make a mess in the code with random variables and methods..........?????????
    44
    5   // todo:: make saving the backup name to report instead of the url like now
     5if(!$ftp_dir)
     6    $ftp_dir = '/public_html';
     7
    68?>
    7 <div class="container">
    8   <h2>Existing backups</h2>
    9   <?php if($backups): ?>
    10     <table id="backups-settings" cellpadding="0" cellspacing="0">
    11       <thead>
     9
     10<div class="container existing-list">
     11    <h2>Existing backups</h2>
     12    <table class="top-options">
    1213        <tr>
    13           <th>Date</th>
    14           <th>Backup name</th>
     14            <td class="first">
     15                <div class="spinner little" style="display: block; float:left;"></div>
     16            </td>
     17            <td class="per-page">
     18                <span class="per-page"><b>Per page:</b></span>
     19                <span data-num="2">2</span>
     20                <span data-num="10">10</span>
     21                <span data-num="25">25</span>
     22                <span data-num="50" class="current">50</span>
     23                <span data-num="75">75</span>
     24                <span data-num="100">100</span>
     25                <span data-num="99999999">All</span>
     26            </td>
     27            <td>
     28                <form action="#" method="post" class="filter" class="left">
     29                    <label for="site-name">Site name: </label>
     30                    <input type="text" name="site" value="" />
     31                    <input type="submit" name="filter" class="filter-submit" value="Find" class="btn little">
     32                </form>
     33            </td>
    1534        </tr>
    16       </thead>
    17       <tbody>
    18         <?php foreach ($backups as $backup): ?>
    19           <?php if($backup->status == 1): ?>
    20             <tr>
    21               <td><?php echo $backup->time; ?></td>
    22               <td><?php echo $backup->url; ?></td>
    23             </tr>
    24           <?php endif; ?>
    25         <?php endforeach; ?>
    26       </tbody>
    2735    </table>
    28   <?php endif; ?>
     36      <table id="existing-backups" cellpadding="1" cellspacing="1">
     37          <thead>
     38          <tr>
     39              <th>Site</th>
     40              <th>Date</th>
     41              <th>Backup name</th>
     42              <th>Action</th>
     43          </tr>
     44          </thead>
     45
     46      </table>
     47
     48      <div class="tablenav">
     49          <div class='tablenav-pages'>
     50            <?php // $pager->show();  // Echo out the list of paging. ?>
     51          </div>
     52      </div>
     53
     54  <?php add_thickbox(); ?>
     55    <div id="ftp-unique-settings" style="display:none;">
     56        <div class="ftp-inner-box">
     57            <form action="#" method="post" id="ftp-site-settings" class="unique-settings">
     58                <div class="field">
     59                    <span><label for="host">Host:</label> <input type="text" name="host" id="host" value="<?php echo $st_host; ?>"></span><br>
     60                    <span><label for="port">Port:</label> <input type="number" name="port" id="port" value="<?php echo $st_port; ?>"></span>
     61                </div>
     62                <div class="field">
     63                    <fieldset>
     64                        <legend>FTP/SFTP</legend>
     65                        <label for="ftp">FTP</label>
     66                        <input type="radio" name="connection" id="ftp" value="ftp" checked>
     67                        <label for="sftp">SFTP</label>
     68                        <input type="radio" name="connection" id="sftp" value="sftp">
     69                    </fieldset>
     70                </div>
     71                <div class="field">
     72                    <fieldset>
     73                        <legend>Mode</legend>
     74                        <label for="pass">Passive</label>
     75                        <input type="radio" name="mode" id="pasv" value="pasv" checked>
     76                        <label for="sftp">Active</label>
     77                        <input type="radio" name="mode" id="actv" value="act">
     78                    </fieldset>
     79                </div>
     80
     81                <div class="field">
     82                    <label for="login">Login</label>
     83                    <input type="text" name="login" id="login" value="<?php echo $st_login; ?>" placeholder="Ftp Login">
     84                </div>
     85                <div class="field">
     86                    <label for="pass">Password</label>
     87                    <input type="password" name="pass" id="pass" value="" placeholder="Password" autocomplete="on">
     88                </div>
     89                <div class="field">
     90                    <label for="dirr">Remote directory</label>
     91                    <input type="text" id="dirr" name="dir" value="<?php echo $ftp_dir; ?>" placeholder="directory name">
     92                </div>
     93                <div class="field">
     94                    <input type="hidden" name="unique_id" value="<?php echo $site_unique_id; ?>">
     95                    <input type="hidden" name="ident" value="ftp">
     96                    <input type="submit" class="btn btn-light btn-little" name="ftp_save_restore" value="Save">
     97                    <button id="test-con-restore" class="btn btn-light btn-little">Test connection</button>
     98                    <button id="return-restore" class="btn btn-light btn-little">Cancel</button>
     99                </div>
     100            </form>
     101        </div>
     102    </div>
     103    <div id="restore-admin-panel">
     104        <div id="restore-admin-panel-inner">
     105            <div class="field">
     106                <a href="#" class="restore-files btn-light btn-little">Restore file system</a>
     107                <a href="#" class="restore-db btn-light btn-little">Restore database</a>
     108                <a href="#" class="restore-all btn-light btn-little">Full recovery</a>
     109                <a href="#" class="change-ftp btn-light btn-little">Change Ftp settings</a>
     110            </div>
     111            <div class="field">
     112                Be careful, by this action will be removed all current files or clean your current database. It depends on your choice.
     113            </div>
     114            <div class="field">
     115                <input type="hidden" name="unique_id" value="<?php echo $site_unique_id; ?>">
     116            </div>
     117
     118        </div>
     119    </div>
     120    <div class="ajax-loader ajax-loader-default" data-text=""></div>
    29121</div>
  • backupsavvy/trunk/parts/scheduller.php

    r1922435 r2236496  
    1 
    2 <h2>Scheduller</h2>
     1<h2>Scheduler</h2>
    32<div class="container">
    43    <div id="add-new-job">
     
    2827                </li>
    2928                <li>
    30                     <input type="submit" value="Add job" />
     29                    <input type="submit" class="btn" value="Add job" />
    3130                    <div class="spinner"></div>
    3231                </li>
     
    4746            <?php
    4847            $title = $time = $action = $num = '&nbsp;';
     48            $job_title = isset($job_title) ? $job_title : '';
    4949            if($sch_jobs) {
    5050                $title = $job_title;
  • backupsavvy/trunk/readme.txt

    r2001033 r2236496  
    1 === BackUpSavvy wordpress plugin ===
    2 Contributors: pdtasktrack
    3 Donate link: http://www.hubroom.com
     1=== BackUpSavvy Premium wordpress plugin ===
     2Contributors: BackupSavvy.com
     3Donate link: https://backupsavvy.com
    44Tags: backup, backup dashboard, wordpress backup, back up, multi backup
    55Requires at least: 4.6
    6 Tested up to: 5.0.2
    7 Stable tag: 1.1
    8 Requires PHP: 5.6
     6Tested up to: 5.3.2
     7Stable tag: 1.2
     8Requires PHP: 7.1
    99
    1010This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
     
    1414== Description ==
    1515
    16  BackUpSavvy is a backup plugin that allows you to backup all sites from
     16 BackUpSavvy Premium is a backup plugin that allows you to backup all sites from
    1717one admin panel.
    1818 It is a simple and comfortable wordpress backup platform.
     
    3333• Save backups in tar.gz, tar, zip, bz2 format (needs gz, bz2,
    3434ZipArchive)
     35• Restore backup
    3536
    3637
     
    5354 9) Go to Scheduler tab
    5455 10) Add new job for automatic backups creation
    55 
    56  == Upgrade Notice ==
    57  = 1.0.0 =
    58  * Initial release.
    59  = 1.0.1 =
    60  * Upgrade is connected to wordpress version upgrading to 5.0.2
    61 
    62  == Changelog ==
    63  = 1.0.0 =
    64  * Initial release.
    65  = 1.0.1 =
    66  * Upgrade is connected to wordpress version upgrading to 5.0.2
Note: See TracChangeset for help on using the changeset viewer.