Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid - Version 1.12.5

Version Description

Release date: January 14th, 2020

  • Update: Adding logging system.
  • Update: Updated dependencies.
Download this release

Release Info

Developer boldgrid
Plugin Icon 128x128 Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid
Version 1.12.5
Comparing to
See all releases

Code changes from version 1.12.4 to 1.12.5

admin/class-boldgrid-backup-admin-archive-fail.php CHANGED
@@ -134,7 +134,6 @@ class Boldgrid_Backup_Admin_Archive_Fail {
134
  * @since 1.5.2
135
  */
136
  public function shutdown() {
137
-
138
  // Free up memory so we have enough to complete this method.
139
  $this->memory = null;
140
 
@@ -151,6 +150,11 @@ class Boldgrid_Backup_Admin_Archive_Fail {
151
 
152
  $last_error = error_get_last();
153
 
 
 
 
 
 
154
  /*
155
  * If there's no error or this is not fatal, abort.
156
  *
134
  * @since 1.5.2
135
  */
136
  public function shutdown() {
 
137
  // Free up memory so we have enough to complete this method.
138
  $this->memory = null;
139
 
150
 
151
  $last_error = error_get_last();
152
 
153
+ // Add a message to the log.
154
+ if ( ! empty( $last_error ) ) {
155
+ $this->core->logger->add( 'PHP shutdown - Error found: ' . print_r( $last_error, 1 ) ); // phpcs:ignore
156
+ }
157
+
158
  /*
159
  * If there's no error or this is not fatal, abort.
160
  *
admin/class-boldgrid-backup-admin-backup-dir.php CHANGED
@@ -97,6 +97,8 @@ class Boldgrid_Backup_Admin_Backup_Dir {
97
 
98
  $backup_dir = untrailingslashit( $backup_dir );
99
 
 
 
100
  $htaccess_path = $backup_dir . DIRECTORY_SEPARATOR . '.htaccess';
101
  $index_html_path = $backup_dir . DIRECTORY_SEPARATOR . 'index.html';
102
  $index_php_path = $backup_dir . DIRECTORY_SEPARATOR . 'index.php';
@@ -107,6 +109,11 @@ class Boldgrid_Backup_Admin_Backup_Dir {
107
  'path' => $backup_dir,
108
  'chmod' => 0700,
109
  ),
 
 
 
 
 
110
  array(
111
  'type' => 'file',
112
  'path' => $htaccess_path,
@@ -234,6 +241,62 @@ class Boldgrid_Backup_Admin_Backup_Dir {
234
  return $this->guess_and_set();
235
  }
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  /**
238
  * Get an array of possible backup directories.
239
  *
97
 
98
  $backup_dir = untrailingslashit( $backup_dir );
99
 
100
+ $logs_dir = $this->get_logs_dir( $backup_dir );
101
+
102
  $htaccess_path = $backup_dir . DIRECTORY_SEPARATOR . '.htaccess';
103
  $index_html_path = $backup_dir . DIRECTORY_SEPARATOR . 'index.html';
104
  $index_php_path = $backup_dir . DIRECTORY_SEPARATOR . 'index.php';
109
  'path' => $backup_dir,
110
  'chmod' => 0700,
111
  ),
112
+ array(
113
+ 'type' => 'dir',
114
+ 'path' => $logs_dir,
115
+ 'chmod' => 0700,
116
+ ),
117
  array(
118
  'type' => 'file',
119
  'path' => $htaccess_path,
241
  return $this->guess_and_set();
242
  }
243
 
244
+ /**
245
+ * Get the directory to our logs folder.
246
+ *
247
+ * @since 1.12.5
248
+ *
249
+ * @param string $backup_dir Backup directory path.
250
+ * @return string The filepath to the logs directory.
251
+ */
252
+ public function get_logs_dir( $backup_dir = null ) {
253
+ $backup_dir = ! empty( $backup_dir ) ? $backup_dir : $this->get();
254
+
255
+ $logs_dir = '';
256
+
257
+ // When looking for an existing logs dir, we'll be looking for a dir beginning with this prefix.
258
+ $prefix = 'logs-' . $this->core->get_backup_identifier() . '-';
259
+
260
+ /*
261
+ * Check to see if we already have a logs directory created.
262
+ *
263
+ * We'll do this by getting a dir list of the backup directory, and then looking for a folder
264
+ * named in this format: logs-[BACKUP IDENTIFIER]-[16 CHARS]
265
+ */
266
+
267
+ // Get directory listing of backup directory.
268
+ $dirlist = $this->core->wp_filesystem->dirlist( $backup_dir );
269
+ $dirlist = is_array( $dirlist ) ? $dirlist : array();
270
+
271
+ // Look for a logs directory.
272
+ foreach ( $dirlist as $file ) {
273
+ if ( 'd' !== $file['type'] ) {
274
+ continue;
275
+ }
276
+
277
+ preg_match( '/^' . $prefix . '[a-zA-Z0-9]{16}$/', $file['name'], $matches );
278
+
279
+ if ( ! empty( $matches ) ) {
280
+ $logs_dir = Boldgrid_Backup_Admin_Utility::trailingslashit( $backup_dir ) . $matches[0];
281
+ break;
282
+ }
283
+ }
284
+
285
+ /*
286
+ * If we need to, create our log directory.
287
+ *
288
+ * We're using the 16 random characters at the end of the folder name to stay consistent with
289
+ * Total Upkeep Premium.
290
+ *
291
+ * @link https://github.com/BoldGrid/boldgrid-backup-premium/blob/ea33c7fc1b9a184d17ee50b2e61e665967595e85/admin/class-boldgrid-backup-premium-admin-historical.php#L165-L175
292
+ */
293
+ if ( empty( $logs_dir ) ) {
294
+ $logs_dir = $backup_dir . DIRECTORY_SEPARATOR . $prefix . substr( md5( time() ), -16 );
295
+ }
296
+
297
+ return $logs_dir;
298
+ }
299
+
300
  /**
301
  * Get an array of possible backup directories.
302
  *
admin/class-boldgrid-backup-admin-core.php CHANGED
@@ -482,6 +482,22 @@ class Boldgrid_Backup_Admin_Core {
482
  */
483
  public $local;
484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  /**
486
  * Path to our config.rating-prompt.php file.
487
  *
@@ -653,6 +669,10 @@ class Boldgrid_Backup_Admin_Core {
653
 
654
  $this->set_lang();
655
 
 
 
 
 
656
  // Need to construct class so necessary filters are added.
657
  if ( class_exists( '\Boldgrid\Library\Library\Ui' ) ) {
658
  $ui = new \Boldgrid\Library\Library\Ui();
@@ -1458,6 +1478,9 @@ class Boldgrid_Backup_Admin_Core {
1458
  * @return array An array of archive file information.
1459
  */
1460
  public function archive_files( $save = false, $dryrun = false ) {
 
 
 
1461
  $this->pre_auto_update = 'pre_auto_update' === current_filter();
1462
 
1463
  /*
@@ -1580,8 +1603,14 @@ class Boldgrid_Backup_Admin_Core {
1580
 
1581
  // Backup the database, if saving an archive file and not a dry run.
1582
  if ( $save && ! $dryrun ) {
 
 
 
1583
  $status = $this->backup_database();
1584
 
 
 
 
1585
  if ( false === $status || ! empty( $status['error'] ) ) {
1586
  return [
1587
  'error' => ! empty( $status['error'] ) ? $status['error'] :
@@ -1619,13 +1648,24 @@ class Boldgrid_Backup_Admin_Core {
1619
 
1620
  // Add the database dump file to the beginning of file list.
1621
  if ( ! empty( $this->db_dump_filepath ) ) {
 
 
1622
  $db_file_array = [
1623
  $this->db_dump_filepath,
1624
  substr( $this->db_dump_filepath, strlen( $backup_directory ) + 1 ),
1625
- $this->wp_filesystem->size( $this->db_dump_filepath ),
1626
  ];
1627
 
1628
  array_unshift( $filelist, $db_file_array );
 
 
 
 
 
 
 
 
 
1629
  }
1630
 
1631
  $this->set_time_limit();
@@ -1644,6 +1684,9 @@ class Boldgrid_Backup_Admin_Core {
1644
 
1645
  Boldgrid_Backup_Admin_In_Progress_Data::set_args( [ 'total_files_todo' => count( $filelist ) ] );
1646
 
 
 
 
1647
  /*
1648
  * Use the chosen compressor to build an archive.
1649
  * If the is no available compressor, then return an error.
@@ -1682,12 +1725,30 @@ class Boldgrid_Backup_Admin_Core {
1682
  break;
1683
  }
1684
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1685
  Boldgrid_Backup_Admin_In_Progress_Data::set_arg( 'status', esc_html__( 'Wrapping things up...', 'boldgrid-backup' ) );
1686
  Boldgrid_Backup_Admin_In_Progress_Data::set_arg( 'percentage', 100 );
1687
 
1688
  $info['total_size'] += $this->filelist->get_total_size( $filelist );
1689
 
1690
- if ( true === $status && ! $this->wp_filesystem->exists( $info['filepath'] ) ) {
1691
  $status = [ 'error' => 'The archive file "' . $info['filepath'] . '" was not written.' ];
1692
  }
1693
 
@@ -1755,9 +1816,13 @@ class Boldgrid_Backup_Admin_Core {
1755
  * also include info about other jobs that were run (such as uploading the backup remotely).
1756
  */
1757
  if ( $this->email->user_wants_notification( 'backup' ) && ! $this->is_scheduled_backup ) {
 
 
1758
  $email_parts = $this->email->post_archive_parts( $info );
1759
  $email_body = $email_parts['body']['main'] . $email_parts['body']['signature'];
1760
  $info['mail_success'] = $this->email->send( $email_parts['subject'], $email_body );
 
 
1761
  }
1762
 
1763
  // If not a dry-run test, update the last backup option and enforce retention.
@@ -1784,6 +1849,9 @@ class Boldgrid_Backup_Admin_Core {
1784
  $this->activity->add( 'any_backup_created', 1, $this->rating_prompt_config );
1785
  }
1786
 
 
 
 
1787
  // Return the array of archive information.
1788
  return $info;
1789
  }
482
  */
483
  public $local;
484
 
485
+ /**
486
+ * Log page.
487
+ *
488
+ * @since 1.12.5
489
+ * @var Boldgrid_Backup_Admin_Log_Page
490
+ */
491
+ public $log_page;
492
+
493
+ /**
494
+ * Logger.
495
+ *
496
+ * @since 1.12.5
497
+ * @var Boldgrid_Backup_Admin_Log
498
+ */
499
+ public $logger;
500
+
501
  /**
502
  * Path to our config.rating-prompt.php file.
503
  *
669
 
670
  $this->set_lang();
671
 
672
+ // Log system.
673
+ $this->logger = new Boldgrid_Backup_Admin_Log( $this );
674
+ $this->log_page = new Boldgrid_Backup_Admin_Log_Page( $this );
675
+
676
  // Need to construct class so necessary filters are added.
677
  if ( class_exists( '\Boldgrid\Library\Library\Ui' ) ) {
678
  $ui = new \Boldgrid\Library\Library\Ui();
1478
  * @return array An array of archive file information.
1479
  */
1480
  public function archive_files( $save = false, $dryrun = false ) {
1481
+ $this->logger->init( 'archive-' . time() . '.log' );
1482
+ $this->logger->add( 'Backup process initialized.' );
1483
+
1484
  $this->pre_auto_update = 'pre_auto_update' === current_filter();
1485
 
1486
  /*
1603
 
1604
  // Backup the database, if saving an archive file and not a dry run.
1605
  if ( $save && ! $dryrun ) {
1606
+ $this->logger->add( 'Starting dump of database...' );
1607
+ $this->logger->add_memory();
1608
+
1609
  $status = $this->backup_database();
1610
 
1611
+ $this->logger->add( 'Dump of database complete! $status = ' . print_r( $status, 1 ) ); // phpcs:ignore
1612
+ $this->logger->add_memory();
1613
+
1614
  if ( false === $status || ! empty( $status['error'] ) ) {
1615
  return [
1616
  'error' => ! empty( $status['error'] ) ? $status['error'] :
1648
 
1649
  // Add the database dump file to the beginning of file list.
1650
  if ( ! empty( $this->db_dump_filepath ) ) {
1651
+ $db_dump_size = $this->wp_filesystem->size( $this->db_dump_filepath );
1652
+
1653
  $db_file_array = [
1654
  $this->db_dump_filepath,
1655
  substr( $this->db_dump_filepath, strlen( $backup_directory ) + 1 ),
1656
+ $db_dump_size,
1657
  ];
1658
 
1659
  array_unshift( $filelist, $db_file_array );
1660
+
1661
+ $this->logger->add(
1662
+ sprintf(
1663
+ 'Database dump file added to file list: %1$s / %2$s (%3$s)',
1664
+ $this->db_dump_filepath,
1665
+ $db_dump_size,
1666
+ size_format( $db_dump_size, 2 )
1667
+ )
1668
+ );
1669
  }
1670
 
1671
  $this->set_time_limit();
1684
 
1685
  Boldgrid_Backup_Admin_In_Progress_Data::set_args( [ 'total_files_todo' => count( $filelist ) ] );
1686
 
1687
+ $this->logger->add( 'Starting archiving of files. Chosen compressor: ' . $info['compressor'] );
1688
+ $this->logger->add_memory();
1689
+
1690
  /*
1691
  * Use the chosen compressor to build an archive.
1692
  * If the is no available compressor, then return an error.
1725
  break;
1726
  }
1727
 
1728
+ $archive_exists = ! empty( $info['filepath'] ) && $this->wp_filesystem->exists( $info['filepath'] );
1729
+ $archive_size = ! $archive_exists ? 0 : $this->wp_filesystem->size( $info['filepath'] );
1730
+
1731
+ // Add additional info to the logs.
1732
+ $this->logger->add( 'Archiving of files complete!' );
1733
+ if ( true !== $status ) {
1734
+ $this->logger->add( 'Archiving of files did not complete successfully: ' . print_r( $status, 1 ) ); // phpcs:ignore
1735
+ }
1736
+ $this->logger->add(
1737
+ sprintf(
1738
+ 'Archive filepath / size: %1$s / %2$s (%3$s)',
1739
+ ( empty( $info['filepath'] ) ? 'MISSING FILEPATH' : $info['filepath'] ),
1740
+ $archive_size,
1741
+ size_format( $archive_size, 2 )
1742
+ )
1743
+ );
1744
+ $this->logger->add_memory();
1745
+
1746
  Boldgrid_Backup_Admin_In_Progress_Data::set_arg( 'status', esc_html__( 'Wrapping things up...', 'boldgrid-backup' ) );
1747
  Boldgrid_Backup_Admin_In_Progress_Data::set_arg( 'percentage', 100 );
1748
 
1749
  $info['total_size'] += $this->filelist->get_total_size( $filelist );
1750
 
1751
+ if ( true === $status && ! $archive_exists ) {
1752
  $status = [ 'error' => 'The archive file "' . $info['filepath'] . '" was not written.' ];
1753
  }
1754
 
1816
  * also include info about other jobs that were run (such as uploading the backup remotely).
1817
  */
1818
  if ( $this->email->user_wants_notification( 'backup' ) && ! $this->is_scheduled_backup ) {
1819
+ $this->logger->add( 'Starting sending of email...' );
1820
+
1821
  $email_parts = $this->email->post_archive_parts( $info );
1822
  $email_body = $email_parts['body']['main'] . $email_parts['body']['signature'];
1823
  $info['mail_success'] = $this->email->send( $email_parts['subject'], $email_body );
1824
+
1825
+ $this->logger->add( 'Sending of email complete! Status: ' . $info['mail_success'] );
1826
  }
1827
 
1828
  // If not a dry-run test, update the last backup option and enforce retention.
1849
  $this->activity->add( 'any_backup_created', 1, $this->rating_prompt_config );
1850
  }
1851
 
1852
+ $this->logger->add( 'Backup complete!' );
1853
+ $this->logger->add_memory();
1854
+
1855
  // Return the array of archive information.
1856
  return $info;
1857
  }
admin/class-boldgrid-backup-admin-log-page.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File: class-boldgrid-backup-admin-log-page.php
4
+ *
5
+ * @link https://www.boldgrid.com
6
+ * @since 1.12.5
7
+ *
8
+ * @package Boldgrid_Backup
9
+ * @subpackage Boldgrid_Backup/admin
10
+ * @copyright BoldGrid
11
+ * @version $Id$
12
+ * @author BoldGrid <support@boldgrid.com>
13
+ */
14
+
15
+ /**
16
+ * Class: Boldgrid_Backup_Admin_Log_page
17
+ *
18
+ * @since 1.12.5
19
+ */
20
+ class Boldgrid_Backup_Admin_Log_Page {
21
+ /**
22
+ * Admin enqueue scripts.
23
+ *
24
+ * @since 1.12.5
25
+ *
26
+ * @param string $hook The current admin page hook.
27
+ */
28
+ public function admin_enqueue_scripts( $hook ) {
29
+ if ( 'total-upkeep_page_boldgrid-backup-tools' === $hook ) {
30
+ $handle = 'boldgrid-backup-admin-logs';
31
+
32
+ wp_register_script(
33
+ $handle,
34
+ plugin_dir_url( __FILE__ ) . 'js/' . $handle . '.js',
35
+ array( 'jquery' ),
36
+ BOLDGRID_BACKUP_VERSION,
37
+ false
38
+ );
39
+
40
+ $translation = array(
41
+ 'loading' => esc_html__( 'Loading log file', 'boldgrid-backup' ),
42
+ 'unknownError' => esc_html__( 'An unknown error occurred. Please close this modal and try again.', 'boldgrid-backup' ),
43
+ );
44
+
45
+ wp_localize_script( $handle, 'BoldGridBackupAdminLogs', $translation );
46
+
47
+ wp_enqueue_script( $handle );
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Render the page for a specific log.
53
+ *
54
+ * @since 1.12.5
55
+ */
56
+ public function wp_ajax_boldgrid_backup_view_log() {
57
+ // Validate permissions.
58
+ if ( ! current_user_can( 'update_plugins' ) ) {
59
+ $markup = '<div class="notice notice-error"><p>' . esc_html__( 'Permission denied.', 'boldgrid-backup' ) . '</p></div>';
60
+ wp_send_json_error( $markup );
61
+ }
62
+
63
+ // Validate nonce.
64
+ if ( ! wp_verify_nonce( $_POST['nonce'], 'boldgrid_backup_view_log' ) ) {
65
+ $markup = '<div class="notice notice-error"><p>' . esc_html__( 'Invalid nonce. Please refresh the page and try again.', 'boldgrid-backup' ) . '</p></div>';
66
+ wp_send_json_error( $markup );
67
+ }
68
+
69
+ $core = apply_filters( 'boldgrid_backup_get_core', null );
70
+
71
+ // Make sure a filename was passsed.
72
+ $filename = ! empty( $_POST['filename'] ) ? sanitize_file_name( $_POST['filename'] ) : null; // phpcs:ignore
73
+ if ( empty( $filename ) ) {
74
+ $markup = '<div class="notice notice-error"><p>' . esc_html__( 'Error: No log filename provided.', 'boldgrid-backup' ) . '</p></div>';
75
+ wp_send_json_error( $markup );
76
+ }
77
+
78
+ // Make sure the log file exists.
79
+ $filepath = $core->backup_dir->get_logs_dir() . DIRECTORY_SEPARATOR . $filename;
80
+ if ( ! $core->wp_filesystem->exists( $filepath ) ) {
81
+ $markup = '<div class="notice notice-error"><p>' . esc_html__( 'Error: Log file does not exist.', 'boldgrid-backup' ) . '</p></div>';
82
+ wp_send_json_error( $markup );
83
+ }
84
+
85
+ // Make sure we don't have an empty file.
86
+ $contents = $core->wp_filesystem->get_contents( $filepath );
87
+ if ( empty( $contents ) ) {
88
+ $markup = '<div class="notice notice-warning"><p>' . esc_html__( 'Log file is empty.', 'boldgrid-backup' ) . '</p></div>';
89
+ wp_send_json_error( $markup );
90
+ }
91
+
92
+ // Good to go.
93
+ $markup = '<div style="overflow:auto;white-space:pre;font-family:\'Courier New\';">' . esc_html( $contents ) . '</div>';
94
+ wp_send_json_success( $markup );
95
+ }
96
+ }
admin/class-boldgrid-backup-admin-log.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File: class-boldgrid-backup-admin-log.php
4
+ *
5
+ * @link https://www.boldgrid.com
6
+ * @since 1.12.5
7
+ *
8
+ * @package Boldgrid_Backup
9
+ * @subpackage Boldgrid_Backup/admin
10
+ * @copyright BoldGrid
11
+ * @version $Id$
12
+ * @author BoldGrid <support@boldgrid.com>
13
+ */
14
+
15
+ /**
16
+ * Class: Boldgrid_Backup_Admin_Log
17
+ *
18
+ * @since 1.12.5
19
+ */
20
+ class Boldgrid_Backup_Admin_Log {
21
+ /**
22
+ * The core class object.
23
+ *
24
+ * @since 1.10.0
25
+ * @access private
26
+ * @var Boldgrid_Backup_Admin_Core
27
+ */
28
+ private $core;
29
+
30
+ /**
31
+ * Log file filename.
32
+ *
33
+ * @since 1.12.5
34
+ * @var string
35
+ * @access private
36
+ */
37
+ private $filename;
38
+
39
+ /**
40
+ * Log file filepath.
41
+ *
42
+ * @since 1.12.5
43
+ * @var string
44
+ * @access private
45
+ */
46
+ private $filepath;
47
+
48
+ /**
49
+ * Constructor.
50
+ *
51
+ * @since 1.10.1
52
+ *
53
+ * @param Boldgrid_Backup_Admin_Core $core Boldgrid_Backup_Admin_Core object.
54
+ */
55
+ public function __construct( Boldgrid_Backup_Admin_Core $core ) {
56
+ $this->core = $core;
57
+ }
58
+
59
+ /**
60
+ * Add a message to the log.
61
+ *
62
+ * @since 1.12.5
63
+ *
64
+ * @param string $message The message to add to the log.
65
+ */
66
+ public function add( $message ) {
67
+ // Add a timestamp to the message.
68
+ $message = date( '[Y-m-d H:i:s e]' ) . ' ' . $message;
69
+
70
+ /*
71
+ * Append the message to the log.
72
+ *
73
+ * WP_Filesystem does not have a way to append to a file, so we're rewriting the file each
74
+ * time. Best route would be to fopen the file and append. This may need to be revisited.
75
+ */
76
+ $file_content = $this->core->wp_filesystem->get_contents( $this->filepath );
77
+ $file_content .= PHP_EOL . $message;
78
+ $this->core->wp_filesystem->put_contents( $this->filepath, $file_content );
79
+ }
80
+
81
+ /**
82
+ * Add info to the log about memory usage.
83
+ *
84
+ * @since 1.12.5
85
+ */
86
+ public function add_memory() {
87
+ $limit = ini_get( 'memory_limit' );
88
+ $memory = memory_get_usage();
89
+ $memory_peak = memory_get_peak_usage();
90
+
91
+ $message = sprintf(
92
+ 'Memory usage - limit / current / peak memory usage: %1$s / %2$s (%3$s) / %4$s (%5$s)',
93
+ $limit,
94
+ $memory,
95
+ size_format( $memory, 2 ),
96
+ $memory_peak,
97
+ size_format( $memory_peak )
98
+ );
99
+
100
+ $this->add( $message );
101
+ }
102
+
103
+ /**
104
+ * Delete old log files.
105
+ *
106
+ * @since 1.12.5
107
+ */
108
+ public function clean_up() {
109
+ // Get a dirlist of our logs dir.
110
+ $logs_dir = $this->core->backup_dir->get_logs_dir();
111
+ $dirlist = $this->core->wp_filesystem->dirlist( $logs_dir );
112
+
113
+ foreach ( $dirlist as $item ) {
114
+ // Skip if this is not a log file.
115
+ if ( 'log' !== pathinfo( $item['name'], PATHINFO_EXTENSION ) ) {
116
+ continue;
117
+ }
118
+
119
+ // Skip if this file is not old enough to delete.
120
+ $is_too_old = time() - $item['lastmodunix'] > $this->core->configs['max_log_age'];
121
+ if ( ! $is_too_old ) {
122
+ continue;
123
+ }
124
+
125
+ $filepath = Boldgrid_Backup_Admin_Utility::trailingslashit( $logs_dir ) . $item['name'];
126
+
127
+ $this->core->wp_filesystem->delete( $filepath );
128
+ }
129
+ }
130
+
131
+ /**
132
+ * Init.
133
+ *
134
+ * @since 1.12.5
135
+ *
136
+ * @param string $filename The filename of the log to create.
137
+ * @return bool Whether or not the log file was created successfully.
138
+ */
139
+ public function init( $filename ) {
140
+ // Purging of old log files is done here, when we're creating a new one.
141
+ $this->clean_up();
142
+
143
+ $this->filename = sanitize_file_name( $filename );
144
+
145
+ $this->filepath = $this->core->backup_dir->get_logs_dir() . DIRECTORY_SEPARATOR . $this->filename;
146
+
147
+ // Create the file.
148
+ return $this->core->wp_filesystem->touch( $this->filepath );
149
+ }
150
+ }
admin/class-boldgrid-backup-admin-tools.php CHANGED
@@ -39,15 +39,28 @@ class Boldgrid_Backup_Admin_Tools {
39
  }
40
 
41
  /**
42
- * Render the tools page.
43
  *
44
- * @since 1.6.0
45
  */
46
- public function page() {
 
 
 
 
 
47
  wp_enqueue_style( 'bglib-ui-css' );
48
  wp_enqueue_script( 'bglib-ui-js' );
49
  wp_enqueue_script( 'bglib-sticky' );
50
 
 
 
 
 
 
 
 
 
 
 
51
  include BOLDGRID_BACKUP_PATH . '/admin/partials/boldgrid-backup-admin-tools.php';
52
  }
53
  }
39
  }
40
 
41
  /**
 
42
  *
 
43
  */
44
+ public function admin_enqueue_scripts( $hook ) {
45
+ if ( 'total-upkeep_page_boldgrid-backup-tools' !== $hook ) {
46
+ return;
47
+ }
48
+
49
+ // Load classes for the UI class. As of @since 1.12.5, moved from self::page to here.
50
  wp_enqueue_style( 'bglib-ui-css' );
51
  wp_enqueue_script( 'bglib-ui-js' );
52
  wp_enqueue_script( 'bglib-sticky' );
53
 
54
+ // Add thickbox functionality. Initially added to support viewing log files.
55
+ add_thickbox();
56
+ }
57
+
58
+ /**
59
+ * Render the tools page.
60
+ *
61
+ * @since 1.6.0
62
+ */
63
+ public function page() {
64
  include BOLDGRID_BACKUP_PATH . '/admin/partials/boldgrid-backup-admin-tools.php';
65
  }
66
  }
admin/compressor/class-boldgrid-backup-admin-compressor-php-zip.php CHANGED
@@ -213,6 +213,15 @@ class Boldgrid_Backup_Admin_Compressor_Php_Zip extends Boldgrid_Backup_Admin_Com
213
  }
214
  }
215
 
 
 
 
 
 
 
 
 
 
216
  /*
217
  * We're done archiving all files.
218
  *
213
  }
214
  }
215
 
216
+ $this->core->logger->add(
217
+ sprintf(
218
+ 'Total files / size archived: %1$s / %2$s (%3$s)',
219
+ $number_files_archived,
220
+ $total_size_archived,
221
+ size_format( $total_size_archived, 2 )
222
+ )
223
+ );
224
+
225
  /*
226
  * We're done archiving all files.
227
  *
admin/js/boldgrid-backup-admin-logs.js ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Backup Logs.
3
+ *
4
+ * @summary This file handles the displaying of log files.
5
+ *
6
+ * @since 1.12.5
7
+ */
8
+
9
+ /* global jQuery */
10
+
11
+ var BOLDGRID = BOLDGRID || {};
12
+
13
+ BOLDGRID.BACKUP = BOLDGRID.BACKUP || {};
14
+
15
+ ( function( $ ) {
16
+ 'use strict';
17
+
18
+ var self;
19
+
20
+ /**
21
+ * Logs.
22
+ *
23
+ * @since 1.12.5
24
+ */
25
+ BOLDGRID.BACKUP.Logs = {
26
+
27
+ /**
28
+ * i18n.
29
+ *
30
+ * @since 1.7.0
31
+ *
32
+ * @type object
33
+ */
34
+ i18n: window.BoldGridBackupAdminLogs || {},
35
+
36
+ /**
37
+ * Init.
38
+ *
39
+ * @since 1.12.5
40
+ */
41
+ init: function() {
42
+ self._onReady();
43
+ },
44
+
45
+ /**
46
+ * Steps to take when a log file is clicked on.
47
+ *
48
+ * @since 1.12.5
49
+ */
50
+ onClickLog: function() {
51
+ var data = {
52
+ action: 'boldgrid_backup_view_log',
53
+ filename: $( this ).attr( 'data-filename' ),
54
+ nonce: $( '#bgbup_log_nonce' ).val()
55
+ };
56
+
57
+ /*
58
+ * Show a loading message in the thickbox modal.
59
+ *
60
+ * Thickbox has a few events, but "on open" is not one of them. The timeout is required
61
+ * to allow some time for the modal to open before we take action. In testing, a 1ms timeout
62
+ * worked. To be on the safe side, we're using 10ms.
63
+ */
64
+ setTimeout( function() {
65
+ $( '#TB_ajaxContent' ).html(
66
+ '<p id="bgbu_thickbox_loading">' +
67
+ self.i18n.loading +
68
+ ' <span class="spinner inline"></span></p>'
69
+ );
70
+ }, 10 );
71
+
72
+ $.post( ajaxurl, data, function( response ) {
73
+ $( '#TB_ajaxContent' ).html( response.data );
74
+ } ).error( function() {
75
+ $( '#TB_ajaxConent' ).html(
76
+ '<div class="notice notice-error"><p>' + unknownError + '<p></div>'
77
+ );
78
+ } );
79
+ },
80
+
81
+ /**
82
+ * On ready.
83
+ *
84
+ * @since 1.7.0
85
+ */
86
+ _onReady: function() {
87
+ $( function() {
88
+ $( '#section_logs a[data-filename]' ).on( 'click', self.onClickLog );
89
+ } );
90
+ }
91
+ };
92
+
93
+ self = BOLDGRID.BACKUP.Logs;
94
+ } )( jQuery );
95
+
96
+ BOLDGRID.BACKUP.Logs.init();
admin/partials/boldgrid-backup-admin-tools.php CHANGED
@@ -28,6 +28,11 @@ $sections = array(
28
  'title' => __( 'Cron Log', 'boldgrid-backup' ),
29
  'content' => $this->core->cron_log->get_markup(),
30
  ),
 
 
 
 
 
31
  ),
32
  );
33
 
28
  'title' => __( 'Cron Log', 'boldgrid-backup' ),
29
  'content' => $this->core->cron_log->get_markup(),
30
  ),
31
+ array(
32
+ 'id' => 'section_logs',
33
+ 'title' => __( 'Logs', 'boldgrid-backup' ),
34
+ 'content' => include BOLDGRID_BACKUP_PATH . '/admin/partials/tools/view-logs.php',
35
+ ),
36
  ),
37
  );
38
 
admin/partials/tools/view-logs.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File: logs.php
4
+ *
5
+ * Show "Auto Updates" on settings page.
6
+ *
7
+ * @link https://www.boldgrid.com
8
+ * @since 1.6.0
9
+ *
10
+ * @package Boldgrid_Backup
11
+ * @subpackage Boldgrid_Backup/admin/partials/tools
12
+ * @copyright BoldGrid
13
+ * @author BoldGrid <support@boldgrid.com>
14
+ */
15
+
16
+ // phpcs:disable WordPress.VIP
17
+
18
+ defined( 'WPINC' ) || die;
19
+
20
+ // Get a listing of all our logs and order them asc.
21
+ $logs_dir = $this->core->backup_dir->get_logs_dir();
22
+ $list = $this->core->wp_filesystem->dirlist( $logs_dir );
23
+ uasort( $list, function( $a, $b ) {
24
+ return $a['lastmodunix'] > $b['lastmodunix'];
25
+ });
26
+
27
+ ob_start();
28
+
29
+ echo '<h2>' . esc_html__( 'Logs', 'boldgrid-backup' ) . '</h2>';
30
+
31
+ if ( empty( $list ) ) {
32
+ echo '<div><em>' . esc_html__( 'No log files exist.', 'boldgrid-backup' ) . '</em></div>';
33
+ } else {
34
+ echo '
35
+ <table class="wp-list-table widefat fixed striped pages">
36
+ <thead>
37
+ <tr>
38
+ <th>' . esc_html__( 'Filename', 'boldgrid-backup' ) . '</th>
39
+ <th>' . esc_html__( 'Size', 'boldgrid-backup' ) . '</th>
40
+ <th>' . esc_html__( 'Timestamp', 'boldgrid-backup' ) . '</th>
41
+ </tr>
42
+ </thead>
43
+ <tbody>';
44
+
45
+ foreach ( $list as $item ) {
46
+ $this->core->time->init( $item['lastmodunix'] );
47
+
48
+ echo '
49
+ <tr>
50
+ <td>
51
+ <a
52
+ title="' . esc_attr( $item['name'] ) . '"
53
+ class="thickbox"
54
+ data-filename="' . esc_attr( $item['name'] ) . '"
55
+ href="#TB_inline&inlineId=bgbkup_show_log">' .
56
+ esc_html( $item['name'] ) .
57
+ '</a>
58
+ </td>
59
+ <td>' . esc_html( size_format( $item['size'] ) ) . '</td>
60
+ <td>' .
61
+ wp_kses(
62
+ $this->core->time->get_span(),
63
+ [
64
+ 'span' => [
65
+ 'title' => [],
66
+ ],
67
+ ]
68
+ ) . '</td>
69
+ </tr>';
70
+ }
71
+
72
+ echo '
73
+ </tbody>
74
+ </table>';
75
+ }
76
+
77
+ wp_nonce_field( 'boldgrid_backup_view_log', 'bgbup_log_nonce' );
78
+
79
+ echo '<div id="bgbkup_show_log" style="display:none;"></div>';
80
+
81
+ $output = ob_get_contents();
82
+ ob_end_clean();
83
+
84
+ return $output;
boldgrid-backup.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Total Upkeep
17
  * Plugin URI: https://www.boldgrid.com/boldgrid-backup/
18
  * Description: Automated backups, remote backup to Amazon S3 and Google Drive, stop website crashes before they happen and more. Total Upkeep is the backup solution you need.
19
- * Version: 1.12.4
20
  * Author: BoldGrid
21
  * Author URI: https://www.boldgrid.com/
22
  * License: GPL-2.0+
16
  * Plugin Name: Total Upkeep
17
  * Plugin URI: https://www.boldgrid.com/boldgrid-backup/
18
  * Description: Automated backups, remote backup to Amazon S3 and Google Drive, stop website crashes before they happen and more. Total Upkeep is the backup solution you need.
19
+ * Version: 1.12.5
20
  * Author: BoldGrid
21
  * Author URI: https://www.boldgrid.com/
22
  * License: GPL-2.0+
coverage.xml CHANGED
@@ -1,6 +1,6 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1578680008">
3
- <project timestamp="1578680008">
4
  <package name="Boldgrid\Backup\Admin\Card">
5
  <file name="/home/travis/build/BoldGrid/boldgrid-backup/admin/card/class-backups.php">
6
  <class name="Backups" namespace="Boldgrid\Backup\Admin\Card">
@@ -730,7 +730,7 @@
730
  </file>
731
  <file name="/home/travis/build/BoldGrid/boldgrid-backup/admin/class-boldgrid-backup-admin-archive-fail.php">
732
  <class name="Boldgrid_Backup_Admin_Archive_Fail" namespace="global" fullPackage="Boldgrid.Backup.Admin.Archive">
733
- <metrics complexity="9" methods="5" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="42" coveredstatements="3" elements="47" coveredelements="4"/>
734
  </class>
735
  <line num="56" type="method" name="__construct" visibility="public" complexity="1" crap="1" count="17"/>
736
  <line num="57" type="stmt" count="17"/>
@@ -757,29 +757,32 @@
757
  <line num="126" type="stmt" count="0"/>
758
  <line num="128" type="stmt" count="0"/>
759
  <line num="129" type="stmt" count="0"/>
760
- <line num="136" type="method" name="shutdown" visibility="public" complexity="5" crap="30" count="0"/>
761
- <line num="139" type="stmt" count="0"/>
762
- <line num="142" type="stmt" count="0"/>
 
763
  <line num="148" type="stmt" count="0"/>
764
  <line num="149" type="stmt" count="0"/>
765
- <line num="150" type="stmt" count="0"/>
766
- <line num="152" type="stmt" count="0"/>
767
- <line num="159" type="stmt" count="0"/>
768
- <line num="160" type="stmt" count="0"/>
769
  <line num="163" type="stmt" count="0"/>
770
  <line num="164" type="stmt" count="0"/>
771
- <line num="165" type="stmt" count="0"/>
772
- <line num="166" type="stmt" count="0"/>
773
  <line num="167" type="stmt" count="0"/>
774
  <line num="168" type="stmt" count="0"/>
775
  <line num="169" type="stmt" count="0"/>
 
776
  <line num="171" type="stmt" count="0"/>
 
777
  <line num="173" type="stmt" count="0"/>
778
- <line num="174" type="stmt" count="0"/>
779
  <line num="175" type="stmt" count="0"/>
780
- <line num="176" type="stmt" count="0"/>
781
  <line num="177" type="stmt" count="0"/>
782
- <metrics loc="178" ncloc="76" classes="1" methods="5" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="42" coveredstatements="3" elements="47" coveredelements="4"/>
 
 
 
 
783
  </file>
784
  <file name="/home/travis/build/BoldGrid/boldgrid-backup/admin/class-boldgrid-backup-admin-archive-log.php">
785
  <class name="Boldgrid_Backup_Admin_Archive_Log" namespace="global" fullPackage="Boldgrid.Backup.Admin.Archive">
@@ -1752,7 +1755,7 @@
1752
  </file>
1753
  <file name="/home/travis/build/BoldGrid/boldgrid-backup/admin/class-boldgrid-backup-admin-backup-dir.php">
1754
  <class name="Boldgrid_Backup_Admin_Backup_Dir" namespace="global" fullPackage="Boldgrid.Backup.Admin.Backup">
1755
- <metrics complexity="54" methods="13" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="175" coveredstatements="101" elements="188" coveredelements="105"/>
1756
  </class>
1757
  <line num="64" type="method" name="__construct" visibility="public" complexity="1" crap="1" count="17"/>
1758
  <line num="65" type="stmt" count="17"/>
@@ -1760,189 +1763,212 @@
1760
  <line num="75" type="method" name="can_exec_write" visibility="public" complexity="1" crap="1" count="1"/>
1761
  <line num="76" type="stmt" count="1"/>
1762
  <line num="78" type="stmt" count="1"/>
1763
- <line num="89" type="method" name="create" visibility="public" complexity="11" crap="11.20" count="2"/>
1764
  <line num="90" type="stmt" count="2"/>
1765
  <line num="93" type="stmt" count="2"/>
1766
  <line num="96" type="stmt" count="2"/>
1767
  <line num="98" type="stmt" count="2"/>
1768
  <line num="100" type="stmt" count="2"/>
1769
- <line num="101" type="stmt" count="2"/>
1770
  <line num="102" type="stmt" count="2"/>
1771
- <line num="106" type="stmt" count="2"/>
1772
- <line num="107" type="stmt" count="2"/>
1773
  <line num="108" type="stmt" count="2"/>
1774
  <line num="109" type="stmt" count="2"/>
 
1775
  <line num="111" type="stmt" count="2"/>
1776
- <line num="112" type="stmt" count="2"/>
1777
  <line num="113" type="stmt" count="2"/>
1778
  <line num="114" type="stmt" count="2"/>
 
1779
  <line num="116" type="stmt" count="2"/>
1780
- <line num="117" type="stmt" count="2"/>
1781
  <line num="118" type="stmt" count="2"/>
 
1782
  <line num="120" type="stmt" count="2"/>
1783
  <line num="121" type="stmt" count="2"/>
1784
- <line num="122" type="stmt" count="2"/>
1785
  <line num="123" type="stmt" count="2"/>
1786
- <line num="133" type="stmt" count="2"/>
1787
- <line num="135" type="stmt" count="2"/>
1788
- <line num="136" type="stmt" count="2"/>
1789
- <line num="137" type="stmt" count="2"/>
1790
- <line num="138" type="stmt" count="2"/>
1791
- <line num="139" type="stmt" count="1"/>
1792
- <line num="140" type="stmt" count="1"/>
1793
- <line num="141" type="stmt" count="1"/>
1794
- <line num="142" type="stmt" count="0"/>
1795
- <line num="143" type="stmt" count="0"/>
1796
- <line num="145" type="stmt" count="1"/>
1797
- <line num="146" type="stmt" count="2"/>
1798
- <line num="147" type="stmt" count="2"/>
1799
- <line num="148" type="stmt" count="2"/>
1800
- <line num="149" type="stmt" count="1"/>
1801
- <line num="150" type="stmt" count="1"/>
1802
- <line num="151" type="stmt" count="0"/>
1803
- <line num="152" type="stmt" count="0"/>
1804
- <line num="155" type="stmt" count="1"/>
 
1805
  <line num="156" type="stmt" count="1"/>
1806
  <line num="157" type="stmt" count="1"/>
1807
  <line num="158" type="stmt" count="0"/>
1808
  <line num="159" type="stmt" count="0"/>
1809
- <line num="161" type="stmt" count="1"/>
1810
  <line num="162" type="stmt" count="1"/>
1811
- <line num="163" type="stmt" count="2"/>
1812
- <line num="164" type="stmt" count="2"/>
1813
- <line num="165" type="stmt" count="2"/>
1814
- <line num="167" type="stmt" count="2"/>
1815
- <line num="177" type="method" name="dirlist" visibility="public" complexity="2" crap="6" count="0"/>
1816
- <line num="178" type="stmt" count="0"/>
1817
- <line num="180" type="stmt" count="0"/>
1818
- <line num="182" type="stmt" count="0"/>
1819
- <line num="183" type="stmt" count="0"/>
1820
- <line num="184" type="stmt" count="0"/>
1821
- <line num="186" type="stmt" count="0"/>
1822
- <line num="197" type="method" name="dirlist_containing" visibility="public" complexity="3" crap="12" count="0"/>
1823
- <line num="198" type="stmt" count="0"/>
1824
- <line num="199" type="stmt" count="0"/>
1825
- <line num="202" type="stmt" count="0"/>
1826
- <line num="203" type="stmt" count="0"/>
1827
- <line num="204" type="stmt" count="0"/>
 
1828
  <line num="205" type="stmt" count="0"/>
1829
  <line num="206" type="stmt" count="0"/>
1830
- <line num="208" type="stmt" count="0"/>
1831
- <line num="218" type="method" name="get" visibility="public" complexity="4" crap="4.25" count="5"/>
1832
- <line num="221" type="stmt" count="5"/>
1833
- <line num="222" type="stmt" count="3"/>
1834
- <line num="226" type="stmt" count="2"/>
1835
- <line num="227" type="stmt" count="2"/>
1836
- <line num="228" type="stmt" count="2"/>
1837
- <line num="229" type="stmt" count="0"/>
1838
- <line num="231" type="stmt" count="0"/>
 
1839
  <line num="234" type="stmt" count="2"/>
1840
- <line num="243" type="method" name="get_possible_dirs" visibility="public" complexity="3" crap="4.46" count="2"/>
1841
- <line num="244" type="stmt" count="2"/>
1842
- <line num="247" type="stmt" count="2"/>
1843
- <line num="249" type="stmt" count="2"/>
1844
- <line num="251" type="stmt" count="0"/>
1845
- <line num="253" type="stmt" count="0"/>
1846
- <line num="264" type="stmt" count="0"/>
1847
- <line num="265" type="stmt" count="0"/>
1848
- <line num="266" type="stmt" count="0"/>
1849
- <line num="267" type="stmt" count="0"/>
1850
- <line num="270" type="stmt" count="2"/>
1851
- <line num="272" type="stmt" count="2"/>
1852
- <line num="285" type="method" name="get_path_to" visibility="public" complexity="1" crap="1" count="2"/>
1853
- <line num="286" type="stmt" count="2"/>
1854
- <line num="287" type="stmt" count="2"/>
1855
- <line num="297" type="method" name="generate_suffix" visibility="public" complexity="2" crap="6" count="0"/>
1856
- <line num="298" type="stmt" count="0"/>
1857
- <line num="299" type="stmt" count="0"/>
1858
- <line num="301" type="stmt" count="0"/>
1859
- <line num="302" type="stmt" count="0"/>
1860
- <line num="303" type="stmt" count="0"/>
1861
- <line num="305" type="stmt" count="0"/>
1862
- <line num="320" type="method" name="guess_and_set" visibility="public" complexity="7" crap="7.29" count="2"/>
1863
- <line num="321" type="stmt" count="2"/>
1864
- <line num="323" type="stmt" count="2"/>
1865
- <line num="325" type="stmt" count="2"/>
1866
- <line num="328" type="stmt" count="2"/>
 
 
 
1867
  <line num="329" type="stmt" count="0"/>
1868
- <line num="339" type="stmt" count="2"/>
1869
- <line num="340" type="stmt" count="2"/>
1870
- <line num="341" type="stmt" count="2"/>
1871
- <line num="343" type="stmt" count="2"/>
1872
- <line num="344" type="stmt" count="0"/>
1873
- <line num="348" type="stmt" count="2"/>
1874
  <line num="349" type="stmt" count="2"/>
1875
- <line num="350" type="stmt" count="0"/>
1876
- <line num="354" type="stmt" count="2"/>
1877
- <line num="355" type="stmt" count="2"/>
1878
- <line num="357" type="stmt" count="2"/>
1879
- <line num="358" type="stmt" count="0"/>
1880
- <line num="361" type="stmt" count="2"/>
1881
- <line num="363" type="stmt" count="2"/>
1882
- <line num="365" type="stmt" count="2"/>
1883
- <line num="367" type="stmt" count="2"/>
1884
- <line num="369" type="stmt" count="2"/>
1885
- <line num="393" type="method" name="file_in_dir" visibility="public" complexity="2" crap="2" count="3"/>
1886
- <line num="394" type="stmt" count="3"/>
1887
- <line num="395" type="stmt" count="3"/>
1888
- <line num="397" type="stmt" count="3"/>
1889
- <line num="411" type="method" name="is_valid" visibility="public" complexity="14" crap="98.54" count="2"/>
1890
- <line num="413" type="stmt" count="2"/>
1891
- <line num="414" type="stmt" count="0"/>
 
 
 
 
 
1892
  <line num="417" type="stmt" count="2"/>
1893
- <line num="419" type="stmt" count="2"/>
1894
- <line num="420" type="stmt" count="0"/>
1895
- <line num="422" type="stmt" count="0"/>
1896
- <line num="424" type="stmt" count="0"/>
1897
- <line num="425" type="stmt" count="0"/>
1898
- <line num="427" type="stmt" count="2"/>
1899
- <line num="428" type="stmt" count="0"/>
1900
- <line num="430" type="stmt" count="0"/>
1901
- <line num="432" type="stmt" count="0"/>
1902
- <line num="433" type="stmt" count="0"/>
1903
- <line num="435" type="stmt" count="2"/>
1904
- <line num="436" type="stmt" count="0"/>
1905
- <line num="438" type="stmt" count="0"/>
1906
- <line num="439" type="stmt" count="0"/>
1907
- <line num="441" type="stmt" count="0"/>
1908
- <line num="443" type="stmt" count="0"/>
1909
- <line num="444" type="stmt" count="0"/>
1910
- <line num="446" type="stmt" count="2"/>
1911
- <line num="447" type="stmt" count="0"/>
1912
- <line num="449" type="stmt" count="0"/>
1913
- <line num="450" type="stmt" count="0"/>
1914
- <line num="452" type="stmt" count="0"/>
1915
- <line num="454" type="stmt" count="0"/>
1916
- <line num="455" type="stmt" count="0"/>
1917
- <line num="457" type="stmt" count="2"/>
1918
- <line num="458" type="stmt" count="0"/>
1919
- <line num="460" type="stmt" count="0"/>
1920
- <line num="461" type="stmt" count="0"/>
1921
- <line num="463" type="stmt" count="0"/>
1922
- <line num="465" type="stmt" count="0"/>
1923
- <line num="466" type="stmt" count="0"/>
1924
- <line num="475" type="stmt" count="2"/>
1925
  <line num="476" type="stmt" count="2"/>
1926
- <line num="477" type="stmt" count="2"/>
1927
- <line num="478" type="stmt" count="0"/>
1928
- <line num="480" type="stmt" count="0"/>
1929
- <line num="481" type="stmt" count="0"/>
1930
  <line num="483" type="stmt" count="0"/>
1931
- <line num="484" type="stmt" count="0"/>
1932
- <line num="486" type="stmt" count="0"/>
1933
  <line num="487" type="stmt" count="0"/>
1934
- <line num="489" type="stmt" count="2"/>
1935
- <line num="501" type="method" name="set" visibility="public" complexity="3" crap="3.10" count="2"/>
1936
- <line num="503" type="stmt" count="2"/>
 
 
 
 
 
 
 
1937
  <line num="504" type="stmt" count="0"/>
1938
- <line num="507" type="stmt" count="2"/>
1939
- <line num="508" type="stmt" count="2"/>
1940
- <line num="509" type="stmt" count="0"/>
1941
- <line num="512" type="stmt" count="2"/>
1942
- <line num="514" type="stmt" count="2"/>
1943
- <line num="515" type="stmt" count="2"/>
1944
- <line num="516" type="stmt" count="2"/>
1945
- <metrics loc="517" ncloc="287" classes="1" methods="13" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="175" coveredstatements="101" elements="188" coveredelements="105"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1946
  </file>
1947
  <file name="/home/travis/build/BoldGrid/boldgrid-backup/admin/class-boldgrid-backup-admin-cli.php">
1948
  <class name="Boldgrid_Backup_Admin_Cli" namespace="global" fullPackage="Boldgrid.Backup.Admin">
@@ -2257,32 +2283,24 @@
2257
  </file>
2258
  <file name="/home/travis/build/BoldGrid/boldgrid-backup/admin/class-boldgrid-backup-admin-core.php">
2259
  <class name="Boldgrid_Backup_Admin_Core" namespace="global" fullPackage="Boldgrid.Backup.Admin">
2260
- <metrics complexity="226" methods="28" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="979" coveredstatements="433" elements="1007" coveredelements="437"/>
2261
  </class>
2262
- <line num="532" type="method" name="__construct" visibility="public" complexity="7" crap="7.03" count="17"/>
2263
- <line num="533" type="stmt" count="17"/>
2264
- <line num="534" type="stmt" count="17"/>
2265
- <line num="535" type="stmt" count="17"/>
2266
- <line num="537" type="stmt" count="17"/>
2267
- <line num="539" type="stmt" count="17"/>
2268
- <line num="540" type="stmt" count="17"/>
2269
- <line num="541" type="stmt" count="17"/>
2270
- <line num="543" type="stmt" count="17"/>
2271
- <line num="545" type="stmt" count="17"/>
2272
- <line num="548" type="stmt" count="17"/>
2273
  <line num="551" type="stmt" count="17"/>
2274
- <line num="554" type="stmt" count="17"/>
 
 
2275
  <line num="557" type="stmt" count="17"/>
2276
- <line num="560" type="stmt" count="17"/>
2277
- <line num="563" type="stmt" count="17"/>
 
2278
  <line num="567" type="stmt" count="17"/>
2279
- <line num="569" type="stmt" count="17"/>
2280
- <line num="571" type="stmt" count="17"/>
2281
  <line num="573" type="stmt" count="17"/>
2282
- <line num="575" type="stmt" count="17"/>
2283
- <line num="577" type="stmt" count="17"/>
2284
  <line num="579" type="stmt" count="17"/>
2285
- <line num="581" type="stmt" count="17"/>
2286
  <line num="583" type="stmt" count="17"/>
2287
  <line num="585" type="stmt" count="17"/>
2288
  <line num="587" type="stmt" count="17"/>
@@ -2316,411 +2334,402 @@
2316
  <line num="643" type="stmt" count="17"/>
2317
  <line num="645" type="stmt" count="17"/>
2318
  <line num="647" type="stmt" count="17"/>
2319
- <line num="650" type="stmt" count="17"/>
2320
- <line num="652" type="stmt" count="17"/>
2321
- <line num="654" type="stmt" count="17"/>
 
2322
  <line num="657" type="stmt" count="17"/>
2323
- <line num="658" type="stmt" count="0"/>
2324
- <line num="659" type="stmt" count="0"/>
2325
- <line num="662" type="stmt" count="17"/>
2326
  <line num="663" type="stmt" count="17"/>
2327
- <line num="664" type="stmt" count="0"/>
2328
- <line num="665" type="stmt" count="0"/>
2329
  <line num="666" type="stmt" count="17"/>
2330
- <line num="667" type="stmt" count="0"/>
2331
- <line num="668" type="stmt" count="0"/>
2332
- <line num="669" type="stmt" count="17"/>
2333
- <line num="678" type="method" name="get_backup_identifier" visibility="public" complexity="5" crap="5.79" count="21"/>
2334
- <line num="680" type="stmt" count="21"/>
2335
- <line num="681" type="stmt" count="4"/>
2336
- <line num="685" type="stmt" count="17"/>
2337
- <line num="688" type="stmt" count="17"/>
2338
- <line num="689" type="stmt" count="16"/>
2339
- <line num="691" type="stmt" count="16"/>
2340
- <line num="695" type="stmt" count="1"/>
2341
- <line num="697" type="stmt" count="1"/>
2342
- <line num="699" type="stmt" count="1"/>
2343
- <line num="702" type="stmt" count="1"/>
2344
- <line num="703" type="stmt" count="0"/>
2345
- <line num="705" type="stmt" count="0"/>
2346
- <line num="706" type="stmt" count="0"/>
2347
- <line num="707" type="stmt" count="0"/>
2348
- <line num="709" type="stmt" count="0"/>
2349
- <line num="710" type="stmt" count="0"/>
2350
- <line num="713" type="stmt" count="1"/>
 
2351
  <line num="715" type="stmt" count="1"/>
2352
  <line num="717" type="stmt" count="1"/>
2353
- <line num="729" type="method" name="get_core" visibility="public" complexity="1" crap="1" count="8"/>
2354
- <line num="730" type="stmt" count="8"/>
2355
- <line num="740" type="method" name="init_premium" visibility="public" complexity="5" crap="30" count="0"/>
2356
- <line num="741" type="stmt" count="0"/>
2357
- <line num="743" type="stmt" count="0"/>
2358
- <line num="749" type="stmt" count="0"/>
2359
- <line num="750" type="stmt" count="0"/>
2360
- <line num="758" type="stmt" count="0"/>
2361
- <line num="759" type="stmt" count="0"/>
 
 
 
 
 
2362
  <line num="761" type="stmt" count="0"/>
2363
- <line num="762" type="stmt" count="0"/>
2364
- <line num="764" type="stmt" count="0"/>
2365
- <line num="765" type="stmt" count="0"/>
2366
- <line num="767" type="stmt" count="0"/>
2367
- <line num="768" type="stmt" count="0"/>
2368
  <line num="769" type="stmt" count="0"/>
2369
  <line num="770" type="stmt" count="0"/>
2370
- <line num="771" type="stmt" count="0"/>
2371
- <line num="772" type="stmt" count="0"/>
2372
- <line num="773" type="stmt" count="0"/>
2373
- <line num="774" type="stmt" count="0"/>
2374
- <line num="775" type="stmt" count="0"/>
2375
- <line num="777" type="stmt" count="0"/>
2376
  <line num="779" type="stmt" count="0"/>
2377
- <line num="780" type="stmt" count="0"/>
2378
  <line num="782" type="stmt" count="0"/>
2379
  <line num="784" type="stmt" count="0"/>
2380
  <line num="785" type="stmt" count="0"/>
2381
- <line num="786" type="stmt" count="0"/>
2382
  <line num="787" type="stmt" count="0"/>
2383
  <line num="788" type="stmt" count="0"/>
 
2384
  <line num="790" type="stmt" count="0"/>
2385
  <line num="791" type="stmt" count="0"/>
2386
  <line num="792" type="stmt" count="0"/>
 
2387
  <line num="794" type="stmt" count="0"/>
 
2388
  <line num="797" type="stmt" count="0"/>
2389
- <line num="798" type="stmt" count="0"/>
2390
  <line num="799" type="stmt" count="0"/>
2391
- <line num="814" type="method" name="execute_command" visibility="public" complexity="6" crap="6.04" count="5"/>
2392
- <line num="816" type="stmt" count="5"/>
 
 
 
 
 
 
 
 
 
2393
  <line num="817" type="stmt" count="0"/>
2394
- <line num="821" type="stmt" count="5"/>
2395
- <line num="822" type="stmt" count="1"/>
2396
- <line num="823" type="stmt" count="1"/>
2397
- <line num="826" type="stmt" count="5"/>
2398
- <line num="827" type="stmt" count="5"/>
2399
- <line num="828" type="stmt" count="5"/>
2400
- <line num="830" type="stmt" count="5"/>
2401
- <line num="832" type="stmt" count="5"/>
2402
- <line num="842" type="method" name="add_menu_items" visibility="public" complexity="5" crap="30" count="0"/>
2403
- <line num="843" type="stmt" count="0"/>
2404
- <line num="846" type="stmt" count="0"/>
2405
- <line num="847" type="stmt" count="0"/>
2406
- <line num="848" type="stmt" count="0"/>
2407
- <line num="849" type="stmt" count="0"/>
2408
- <line num="850" type="stmt" count="0"/>
2409
- <line num="851" type="stmt" count="0"/>
2410
- <line num="852" type="stmt" count="0"/>
2411
- <line num="853" type="stmt" count="0"/>
2412
- <line num="854" type="stmt" count="0"/>
2413
- <line num="857" type="stmt" count="0"/>
2414
- <line num="860" type="stmt" count="0"/>
2415
  <line num="863" type="stmt" count="0"/>
2416
- <line num="864" type="stmt" count="0"/>
2417
- <line num="865" type="stmt" count="0"/>
2418
  <line num="866" type="stmt" count="0"/>
2419
  <line num="867" type="stmt" count="0"/>
 
2420
  <line num="869" type="stmt" count="0"/>
2421
  <line num="870" type="stmt" count="0"/>
2422
  <line num="871" type="stmt" count="0"/>
 
2423
  <line num="873" type="stmt" count="0"/>
2424
- <line num="876" type="stmt" count="0"/>
2425
  <line num="877" type="stmt" count="0"/>
2426
- <line num="878" type="stmt" count="0"/>
2427
- <line num="879" type="stmt" count="0"/>
2428
  <line num="880" type="stmt" count="0"/>
2429
- <line num="881" type="stmt" count="0"/>
2430
  <line num="883" type="stmt" count="0"/>
2431
  <line num="884" type="stmt" count="0"/>
 
2432
  <line num="886" type="stmt" count="0"/>
 
2433
  <line num="889" type="stmt" count="0"/>
2434
  <line num="890" type="stmt" count="0"/>
2435
  <line num="891" type="stmt" count="0"/>
2436
- <line num="892" type="stmt" count="0"/>
2437
  <line num="893" type="stmt" count="0"/>
2438
- <line num="894" type="stmt" count="0"/>
2439
  <line num="896" type="stmt" count="0"/>
2440
  <line num="897" type="stmt" count="0"/>
 
2441
  <line num="899" type="stmt" count="0"/>
2442
- <line num="902" type="stmt" count="0"/>
 
2443
  <line num="903" type="stmt" count="0"/>
2444
  <line num="904" type="stmt" count="0"/>
2445
- <line num="905" type="stmt" count="0"/>
2446
  <line num="906" type="stmt" count="0"/>
2447
- <line num="907" type="stmt" count="0"/>
2448
  <line num="909" type="stmt" count="0"/>
2449
  <line num="910" type="stmt" count="0"/>
 
2450
  <line num="912" type="stmt" count="0"/>
2451
- <line num="915" type="stmt" count="0"/>
 
2452
  <line num="916" type="stmt" count="0"/>
2453
  <line num="917" type="stmt" count="0"/>
2454
- <line num="918" type="stmt" count="0"/>
2455
  <line num="919" type="stmt" count="0"/>
2456
- <line num="920" type="stmt" count="0"/>
2457
  <line num="922" type="stmt" count="0"/>
2458
  <line num="923" type="stmt" count="0"/>
 
2459
  <line num="925" type="stmt" count="0"/>
 
 
 
 
2460
  <line num="932" type="stmt" count="0"/>
2461
- <line num="933" type="stmt" count="0"/>
2462
- <line num="934" type="stmt" count="0"/>
2463
  <line num="935" type="stmt" count="0"/>
2464
  <line num="936" type="stmt" count="0"/>
2465
  <line num="937" type="stmt" count="0"/>
 
2466
  <line num="939" type="stmt" count="0"/>
2467
  <line num="940" type="stmt" count="0"/>
2468
  <line num="942" type="stmt" count="0"/>
 
2469
  <line num="945" type="stmt" count="0"/>
2470
- <line num="946" type="stmt" count="0"/>
2471
- <line num="947" type="stmt" count="0"/>
2472
- <line num="948" type="stmt" count="0"/>
2473
- <line num="949" type="stmt" count="0"/>
2474
- <line num="950" type="stmt" count="0"/>
2475
  <line num="952" type="stmt" count="0"/>
2476
  <line num="953" type="stmt" count="0"/>
 
2477
  <line num="955" type="stmt" count="0"/>
2478
- <line num="958" type="stmt" count="0"/>
 
2479
  <line num="959" type="stmt" count="0"/>
2480
  <line num="960" type="stmt" count="0"/>
2481
- <line num="961" type="stmt" count="0"/>
2482
  <line num="962" type="stmt" count="0"/>
2483
- <line num="963" type="stmt" count="0"/>
2484
  <line num="965" type="stmt" count="0"/>
2485
  <line num="966" type="stmt" count="0"/>
 
2486
  <line num="968" type="stmt" count="0"/>
2487
- <line num="971" type="stmt" count="0"/>
 
2488
  <line num="972" type="stmt" count="0"/>
2489
  <line num="973" type="stmt" count="0"/>
2490
- <line num="974" type="stmt" count="0"/>
2491
  <line num="975" type="stmt" count="0"/>
2492
- <line num="976" type="stmt" count="0"/>
2493
  <line num="978" type="stmt" count="0"/>
2494
  <line num="979" type="stmt" count="0"/>
 
2495
  <line num="981" type="stmt" count="0"/>
 
 
 
 
2496
  <line num="988" type="stmt" count="0"/>
2497
- <line num="989" type="stmt" count="0"/>
2498
  <line num="991" type="stmt" count="0"/>
2499
  <line num="992" type="stmt" count="0"/>
2500
  <line num="993" type="stmt" count="0"/>
2501
  <line num="994" type="stmt" count="0"/>
2502
  <line num="995" type="stmt" count="0"/>
2503
- <line num="997" type="stmt" count="0"/>
2504
- <line num="1005" type="stmt" count="0"/>
2505
- <line num="1006" type="stmt" count="0"/>
2506
- <line num="1007" type="stmt" count="0"/>
2507
  <line num="1008" type="stmt" count="0"/>
2508
  <line num="1009" type="stmt" count="0"/>
2509
- <line num="1010" type="stmt" count="0"/>
2510
  <line num="1011" type="stmt" count="0"/>
2511
  <line num="1012" type="stmt" count="0"/>
2512
  <line num="1013" type="stmt" count="0"/>
2513
- <line num="1022" type="method" name="admin_enqueue_scripts" visibility="public" complexity="1" crap="2" count="0"/>
2514
- <line num="1023" type="stmt" count="0"/>
2515
- <line num="1024" type="stmt" count="0"/>
2516
  <line num="1025" type="stmt" count="0"/>
2517
  <line num="1026" type="stmt" count="0"/>
 
2518
  <line num="1028" type="stmt" count="0"/>
 
2519
  <line num="1030" type="stmt" count="0"/>
2520
  <line num="1031" type="stmt" count="0"/>
2521
  <line num="1032" type="stmt" count="0"/>
2522
  <line num="1033" type="stmt" count="0"/>
2523
- <line num="1035" type="stmt" count="0"/>
2524
- <line num="1036" type="stmt" count="0"/>
2525
- <line num="1048" type="method" name="backup_database" visibility="private" complexity="7" crap="13.12" count="3"/>
2526
- <line num="1053" type="stmt" count="3"/>
2527
- <line num="1054" type="stmt" count="0"/>
2528
- <line num="1058" type="stmt" count="3"/>
2529
- <line num="1060" type="stmt" count="0"/>
2530
- <line num="1061" type="stmt" count="0"/>
2531
- <line num="1065" type="stmt" count="3"/>
2532
- <line num="1068" type="stmt" count="3"/>
2533
- <line num="1071" type="stmt" count="3"/>
2534
- <line num="1073" type="stmt" count="0"/>
2535
- <line num="1075" type="stmt" count="0"/>
2536
- <line num="1077" type="stmt" count="0"/>
2537
- <line num="1078" type="stmt" count="0"/>
2538
- <line num="1082" type="stmt" count="3"/>
 
 
2539
  <line num="1085" type="stmt" count="3"/>
2540
- <line num="1087" type="stmt" count="3"/>
2541
- <line num="1090" type="stmt" count="3"/>
2542
  <line num="1091" type="stmt" count="3"/>
2543
- <line num="1092" type="stmt" count="0"/>
2544
- <line num="1096" type="stmt" count="3"/>
2545
- <line num="1097" type="stmt" count="3"/>
2546
- <line num="1099" type="stmt" count="0"/>
2547
- <line num="1101" type="stmt" count="0"/>
2548
- <line num="1103" type="stmt" count="0"/>
2549
- <line num="1104" type="stmt" count="0"/>
2550
- <line num="1106" type="stmt" count="3"/>
2551
  <line num="1107" type="stmt" count="3"/>
2552
- <line num="1109" type="stmt" count="0"/>
2553
- <line num="1111" type="stmt" count="0"/>
2554
- <line num="1113" type="stmt" count="0"/>
2555
- <line num="1114" type="stmt" count="0"/>
2556
- <line num="1118" type="stmt" count="3"/>
2557
- <line num="1121" type="stmt" count="3"/>
2558
- <line num="1141" type="method" name="restore_database" visibility="private" complexity="9" crap="26.50" count="1"/>
2559
- <line num="1143" type="stmt" count="1"/>
2560
- <line num="1145" type="stmt" count="0"/>
2561
- <line num="1146" type="stmt" count="0"/>
2562
- <line num="1147" type="stmt" count="0"/>
2563
- <line num="1149" type="stmt" count="0"/>
2564
- <line num="1151" type="stmt" count="0"/>
2565
- <line num="1155" type="stmt" count="1"/>
2566
- <line num="1157" type="stmt" count="0"/>
2567
- <line num="1159" type="stmt" count="0"/>
 
 
2568
  <line num="1163" type="stmt" count="1"/>
2569
- <line num="1166" type="stmt" count="1"/>
2570
- <line num="1169" type="stmt" count="1"/>
2571
- <line num="1170" type="stmt" count="1"/>
2572
- <line num="1172" type="stmt" count="1"/>
2573
- <line num="1174" type="stmt" count="1"/>
2574
- <line num="1180" type="stmt" count="0"/>
2575
- <line num="1181" type="stmt" count="0"/>
2576
- <line num="1184" type="stmt" count="1"/>
2577
- <line num="1185" type="stmt" count="1"/>
2578
- <line num="1187" type="stmt" count="1"/>
2579
- <line num="1188" type="stmt" count="0"/>
2580
- <line num="1189" type="stmt" count="0"/>
2581
- <line num="1193" type="stmt" count="1"/>
2582
- <line num="1195" type="stmt" count="0"/>
2583
- <line num="1198" type="stmt" count="0"/>
2584
- <line num="1199" type="stmt" count="0"/>
2585
- <line num="1202" type="stmt" count="1"/>
2586
  <line num="1205" type="stmt" count="1"/>
2587
- <line num="1206" type="stmt" count="1"/>
2588
- <line num="1209" type="stmt" count="1"/>
2589
- <line num="1211" type="stmt" count="0"/>
2590
- <line num="1213" type="stmt" count="0"/>
2591
  <line num="1215" type="stmt" count="0"/>
2592
- <line num="1216" type="stmt" count="0"/>
2593
- <line num="1217" type="stmt" count="0"/>
2594
  <line num="1218" type="stmt" count="0"/>
2595
- <line num="1220" type="stmt" count="0"/>
2596
- <line num="1222" type="stmt" count="0"/>
2597
- <line num="1223" type="stmt" count="0"/>
2598
- <line num="1224" type="stmt" count="0"/>
2599
- <line num="1227" type="stmt" count="1"/>
2600
- <line num="1230" type="stmt" count="0"/>
2601
- <line num="1232" type="stmt" count="0"/>
2602
  <line num="1233" type="stmt" count="0"/>
2603
- <line num="1236" type="stmt" count="1"/>
2604
- <line num="1247" type="method" name="get_filelist" visibility="public" complexity="10" crap="10.11" count="3"/>
2605
- <line num="1250" type="stmt" count="3"/>
2606
- <line num="1251" type="stmt" count="0"/>
2607
- <line num="1255" type="stmt" count="3"/>
2608
- <line num="1258" type="stmt" count="3"/>
2609
- <line num="1259" type="stmt" count="0"/>
2610
- <line num="1263" type="stmt" count="3"/>
2611
- <line num="1266" type="stmt" count="3"/>
2612
- <line num="1267" type="stmt" count="3"/>
2613
- <line num="1268" type="stmt" count="3"/>
2614
- <line num="1271" type="stmt" count="3"/>
2615
- <line num="1274" type="stmt" count="3"/>
2616
- <line num="1285" type="stmt" count="3"/>
 
 
 
 
 
 
2617
  <line num="1286" type="stmt" count="3"/>
2618
  <line num="1287" type="stmt" count="3"/>
2619
  <line num="1288" type="stmt" count="3"/>
2620
- <line num="1289" type="stmt" count="3"/>
2621
  <line num="1291" type="stmt" count="3"/>
2622
- <line num="1293" type="stmt" count="3"/>
2623
- <line num="1296" type="stmt" count="3"/>
2624
- <line num="1297" type="stmt" count="0"/>
2625
- <line num="1299" type="stmt" count="3"/>
2626
- <line num="1300" type="stmt" count="3"/>
2627
- <line num="1303" type="stmt" count="3"/>
2628
- <line num="1304" type="stmt" count="3"/>
2629
- <line num="1307" type="stmt" count="0"/>
2630
  <line num="1309" type="stmt" count="3"/>
2631
- <line num="1312" type="stmt" count="3"/>
2632
- <line num="1314" type="stmt" count="3"/>
2633
- <line num="1315" type="stmt" count="3"/>
2634
- <line num="1317" type="stmt" count="3"/>
2635
  <line num="1319" type="stmt" count="3"/>
 
2636
  <line num="1323" type="stmt" count="3"/>
2637
- <line num="1326" type="stmt" count="3"/>
 
2638
  <line num="1329" type="stmt" count="3"/>
2639
- <line num="1330" type="stmt" count="3"/>
2640
- <line num="1331" type="stmt" count="3"/>
2641
  <line num="1332" type="stmt" count="3"/>
2642
  <line num="1334" type="stmt" count="3"/>
 
2643
  <line num="1337" type="stmt" count="3"/>
2644
- <line num="1353" type="method" name="get_filtered_filelist" visibility="public" complexity="8" crap="8.30" count="3"/>
2645
- <line num="1356" type="stmt" count="3"/>
2646
- <line num="1357" type="stmt" count="0"/>
2647
- <line num="1361" type="stmt" count="3"/>
2648
- <line num="1364" type="stmt" count="3"/>
2649
- <line num="1365" type="stmt" count="0"/>
2650
- <line num="1369" type="stmt" count="3"/>
2651
- <line num="1372" type="stmt" count="3"/>
2652
- <line num="1375" type="stmt" count="3"/>
 
2653
  <line num="1376" type="stmt" count="3"/>
2654
- <line num="1378" type="stmt" count="3"/>
2655
- <line num="1379" type="stmt" count="0"/>
2656
- <line num="1382" type="stmt" count="3"/>
2657
- <line num="1383" type="stmt" count="3"/>
2658
- <line num="1386" type="stmt" count="3"/>
2659
- <line num="1387" type="stmt" count="3"/>
2660
- <line num="1390" type="stmt" count="3"/>
2661
- <line num="1393" type="stmt" count="3"/>
2662
  <line num="1396" type="stmt" count="3"/>
2663
- <line num="1408" type="method" name="generate_archive_path" visibility="public" complexity="3" crap="3.00" count="3"/>
 
 
 
 
 
2664
  <line num="1410" type="stmt" count="3"/>
2665
  <line num="1413" type="stmt" count="3"/>
2666
  <line num="1416" type="stmt" count="3"/>
2667
- <line num="1417" type="stmt" count="0"/>
2668
- <line num="1421" type="stmt" count="3"/>
2669
- <line num="1424" type="stmt" count="3"/>
2670
- <line num="1426" type="stmt" count="3"/>
2671
- <line num="1427" type="stmt" count="3"/>
2672
- <line num="1428" type="stmt" count="3"/>
2673
- <line num="1429" type="stmt" count="3"/>
2674
  <line num="1430" type="stmt" count="3"/>
2675
- <line num="1431" type="stmt" count="3"/>
2676
- <line num="1432" type="stmt" count="3"/>
2677
- <line num="1435" type="stmt" count="3"/>
2678
- <line num="1438" type="stmt" count="3"/>
2679
- <line num="1440" type="stmt" count="3"/>
2680
- <line num="1442" type="stmt" count="3"/>
2681
- <line num="1443" type="stmt" count="3"/>
2682
- <line num="1445" type="stmt" count="3"/>
2683
- <line num="1460" type="method" name="archive_files" visibility="public" complexity="45" crap="113.10" count="3"/>
2684
- <line num="1461" type="stmt" count="3"/>
2685
- <line num="1467" type="stmt" count="3"/>
2686
- <line num="1469" type="stmt" count="3"/>
2687
- <line num="1470" type="stmt" count="3"/>
2688
- <line num="1471" type="stmt" count="3"/>
2689
- <line num="1478" type="stmt" count="3"/>
2690
- <line num="1480" type="stmt" count="3"/>
 
 
 
2691
  <line num="1481" type="stmt" count="3"/>
2692
  <line num="1482" type="stmt" count="3"/>
 
 
 
2693
  <line num="1493" type="stmt" count="3"/>
2694
- <line num="1494" type="stmt" count="0"/>
2695
- <line num="1495" type="stmt" count="0"/>
2696
- <line num="1496" type="stmt" count="0"/>
2697
- <line num="1500" type="stmt" count="3"/>
2698
- <line num="1502" type="stmt" count="0"/>
2699
- <line num="1504" type="stmt" count="0"/>
2700
- <line num="1505" type="stmt" count="0"/>
2701
- <line num="1507" type="stmt" count="0"/>
2702
- <line num="1511" type="stmt" count="3"/>
2703
- <line num="1520" type="stmt" count="3"/>
2704
- <line num="1521" type="stmt" count="3"/>
2705
- <line num="1522" type="stmt" count="3"/>
2706
  <line num="1523" type="stmt" count="3"/>
2707
- <line num="1524" type="stmt" count="3"/>
2708
- <line num="1525" type="stmt" count="3"/>
2709
- <line num="1526" type="stmt" count="3"/>
2710
- <line num="1527" type="stmt" count="3"/>
2711
- <line num="1528" type="stmt" count="3"/>
2712
- <line num="1529" type="stmt" count="3"/>
2713
- <line num="1530" type="stmt" count="3"/>
2714
- <line num="1532" type="stmt" count="3"/>
2715
- <line num="1533" type="stmt" count="3"/>
2716
  <line num="1534" type="stmt" count="3"/>
2717
- <line num="1535" type="stmt" count="3"/>
2718
- <line num="1537" type="stmt" count="3"/>
2719
- <line num="1538" type="stmt" count="3"/>
2720
- <line num="1539" type="stmt" count="3"/>
2721
- <line num="1540" type="stmt" count="3"/>
2722
- <line num="1541" type="stmt" count="3"/>
2723
- <line num="1542" type="stmt" count="3"/>
2724
  <line num="1543" type="stmt" count="3"/>
2725
  <line num="1544" type="stmt" count="3"/>
2726
  <line num="1545" type="stmt" count="3"/>
@@ -2728,552 +2737,607 @@
2728
  <line num="1547" type="stmt" count="3"/>
2729
  <line num="1548" type="stmt" count="3"/>
2730
  <line num="1549" type="stmt" count="3"/>
 
 
2731
  <line num="1552" type="stmt" count="3"/>
2732
- <line num="1553" type="stmt" count="0"/>
2733
- <line num="1554" type="stmt" count="3"/>
2734
- <line num="1555" type="stmt" count="0"/>
2735
- <line num="1556" type="stmt" count="0"/>
2736
  <line num="1557" type="stmt" count="3"/>
2737
- <line num="1558" type="stmt" count="0"/>
2738
- <line num="1559" type="stmt" count="3"/>
2739
- <line num="1560" type="stmt" count="0"/>
2740
- <line num="1561" type="stmt" count="0"/>
2741
  <line num="1562" type="stmt" count="3"/>
 
 
2742
  <line num="1565" type="stmt" count="3"/>
 
 
2743
  <line num="1568" type="stmt" count="3"/>
2744
- <line num="1569" type="stmt" count="0"/>
2745
- <line num="1573" type="stmt" count="3"/>
2746
- <line num="1576" type="stmt" count="3"/>
2747
- <line num="1579" type="stmt" count="3"/>
 
 
 
 
 
 
 
2748
  <line num="1582" type="stmt" count="3"/>
2749
- <line num="1583" type="stmt" count="3"/>
 
2750
  <line num="1585" type="stmt" count="3"/>
2751
- <line num="1587" type="stmt" count="0"/>
2752
- <line num="1588" type="stmt" count="0"/>
2753
- <line num="1589" type="stmt" count="0"/>
2754
  <line num="1591" type="stmt" count="3"/>
2755
- <line num="1594" type="stmt" count="3"/>
2756
- <line num="1597" type="stmt" count="3"/>
2757
- <line num="1600" type="stmt" count="3"/>
2758
- <line num="1603" type="stmt" count="3"/>
2759
- <line num="1604" type="stmt" count="0"/>
2760
- <line num="1606" type="stmt" count="0"/>
2761
- <line num="1607" type="stmt" count="0"/>
2762
- <line num="1609" type="stmt" count="0"/>
2763
- <line num="1613" type="stmt" count="3"/>
2764
- <line num="1616" type="stmt" count="3"/>
 
 
2765
  <line num="1617" type="stmt" count="0"/>
2766
- <line num="1621" type="stmt" count="3"/>
 
2767
  <line num="1623" type="stmt" count="3"/>
2768
- <line num="1624" type="stmt" count="3"/>
2769
- <line num="1625" type="stmt" count="3"/>
2770
  <line num="1626" type="stmt" count="3"/>
2771
- <line num="1628" type="stmt" count="3"/>
2772
  <line num="1629" type="stmt" count="3"/>
2773
- <line num="1631" type="stmt" count="3"/>
2774
- <line num="1643" type="stmt" count="3"/>
 
 
 
 
2775
  <line num="1645" type="stmt" count="3"/>
 
 
2776
  <line num="1651" type="stmt" count="3"/>
2777
- <line num="1652" type="stmt" count="3"/>
2778
- <line num="1653" type="stmt" count="3"/>
2779
  <line num="1654" type="stmt" count="3"/>
2780
  <line num="1655" type="stmt" count="3"/>
2781
- <line num="1656" type="stmt" count="0"/>
2782
- <line num="1657" type="stmt" count="0"/>
2783
- <line num="1658" type="stmt" count="0"/>
2784
- <line num="1659" type="stmt" count="0"/>
2785
- <line num="1660" type="stmt" count="0"/>
2786
- <line num="1662" type="stmt" count="0"/>
2787
- <line num="1663" type="stmt" count="0"/>
2788
- <line num="1664" type="stmt" count="0"/>
2789
- <line num="1666" type="stmt" count="0"/>
2790
- <line num="1667" type="stmt" count="0"/>
2791
- <line num="1668" type="stmt" count="0"/>
2792
- <line num="1670" type="stmt" count="0"/>
2793
- <line num="1671" type="stmt" count="0"/>
2794
- <line num="1672" type="stmt" count="0"/>
2795
- <line num="1674" type="stmt" count="0"/>
2796
- <line num="1675" type="stmt" count="0"/>
2797
- <line num="1676" type="stmt" count="0"/>
2798
- <line num="1678" type="stmt" count="0"/>
2799
- <line num="1679" type="stmt" count="0"/>
2800
- <line num="1680" type="stmt" count="0"/>
2801
- <line num="1681" type="stmt" count="0"/>
2802
- <line num="1682" type="stmt" count="0"/>
2803
  <line num="1683" type="stmt" count="3"/>
2804
  <line num="1685" type="stmt" count="3"/>
2805
- <line num="1686" type="stmt" count="3"/>
2806
  <line num="1688" type="stmt" count="3"/>
2807
- <line num="1690" type="stmt" count="3"/>
2808
- <line num="1691" type="stmt" count="0"/>
2809
- <line num="1692" type="stmt" count="0"/>
2810
  <line num="1694" type="stmt" count="3"/>
2811
- <line num="1695" type="stmt" count="0"/>
 
 
2812
  <line num="1698" type="stmt" count="3"/>
2813
- <line num="1700" type="stmt" count="3"/>
2814
- <line num="1702" type="stmt" count="3"/>
2815
- <line num="1705" type="stmt" count="3"/>
2816
- <line num="1708" type="stmt" count="3"/>
2817
- <line num="1709" type="stmt" count="3"/>
2818
- <line num="1712" type="stmt" count="3"/>
2819
- <line num="1715" type="stmt" count="3"/>
2820
- <line num="1716" type="stmt" count="3"/>
2821
- <line num="1717" type="stmt" count="3"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2822
  <line num="1746" type="stmt" count="3"/>
2823
- <line num="1757" type="stmt" count="3"/>
2824
- <line num="1758" type="stmt" count="3"/>
 
 
 
 
 
2825
  <line num="1759" type="stmt" count="3"/>
2826
- <line num="1760" type="stmt" count="3"/>
2827
  <line num="1761" type="stmt" count="3"/>
2828
- <line num="1764" type="stmt" count="3"/>
2829
  <line num="1766" type="stmt" count="3"/>
2830
- <line num="1768" type="stmt" count="3"/>
2831
- <line num="1771" type="stmt" count="3"/>
2832
  <line num="1773" type="stmt" count="3"/>
2833
- <line num="1774" type="stmt" count="3"/>
2834
  <line num="1777" type="stmt" count="3"/>
2835
- <line num="1778" type="stmt" count="0"/>
2836
- <line num="1779" type="stmt" count="0"/>
2837
- <line num="1781" type="stmt" count="3"/>
2838
- <line num="1783" type="stmt" count="3"/>
2839
- <line num="1784" type="stmt" count="0"/>
2840
- <line num="1785" type="stmt" count="0"/>
2841
- <line num="1788" type="stmt" count="3"/>
2842
- <line num="1809" type="method" name="get_archive_list" visibility="public" complexity="11" crap="11.15" count="4"/>
2843
- <line num="1811" type="stmt" count="4"/>
2844
- <line num="1814" type="stmt" count="4"/>
2845
- <line num="1817" type="stmt" count="4"/>
2846
- <line num="1818" type="stmt" count="4"/>
2847
- <line num="1819" type="stmt" count="4"/>
2848
- <line num="1822" type="stmt" count="4"/>
2849
- <line num="1823" type="stmt" count="0"/>
2850
- <line num="1827" type="stmt" count="4"/>
2851
- <line num="1830" type="stmt" count="4"/>
2852
- <line num="1831" type="stmt" count="0"/>
2853
- <line num="1835" type="stmt" count="4"/>
2854
- <line num="1836" type="stmt" count="0"/>
2855
- <line num="1838" type="stmt" count="4"/>
2856
  <line num="1839" type="stmt" count="3"/>
2857
- <line num="1842" type="stmt" count="4"/>
2858
- <line num="1843" type="stmt" count="3"/>
2859
- <line num="1846" type="stmt" count="4"/>
2860
- <line num="1848" type="stmt" count="4"/>
2861
- <line num="1851" type="stmt" count="4"/>
2862
- <line num="1854" type="stmt" count="4"/>
2863
- <line num="1855" type="stmt" count="4"/>
2864
- <line num="1857" type="stmt" count="3"/>
2865
- <line num="1860" type="stmt" count="3"/>
2866
- <line num="1861" type="stmt" count="0"/>
2867
- <line num="1866" type="stmt" count="3"/>
2868
- <line num="1867" type="stmt" count="3"/>
2869
- <line num="1868" type="stmt" count="3"/>
2870
- <line num="1869" type="stmt" count="3"/>
2871
- <line num="1870" type="stmt" count="3"/>
2872
- <line num="1871" type="stmt" count="3"/>
2873
- <line num="1872" type="stmt" count="3"/>
2874
- <line num="1873" type="stmt" count="3"/>
2875
- <line num="1877" type="stmt" count="3"/>
2876
- <line num="1878" type="stmt" count="1"/>
2877
- <line num="1880" type="stmt" count="3"/>
2878
- <line num="1881" type="stmt" count="4"/>
2879
- <line num="1884" type="stmt" count="4"/>
2880
- <line num="1895" type="method" name="delete_archive_file" visibility="public" complexity="11" crap="132" count="0"/>
2881
- <line num="1898" type="stmt" count="0"/>
2882
  <line num="1899" type="stmt" count="0"/>
2883
- <line num="1903" type="stmt" count="0"/>
2884
- <line num="1906" type="stmt" count="0"/>
2885
- <line num="1909" type="stmt" count="0"/>
2886
- <line num="1910" type="stmt" count="0"/>
2887
- <line num="1911" type="stmt" count="0"/>
2888
- <line num="1912" type="stmt" count="0"/>
2889
- <line num="1914" type="stmt" count="0"/>
2890
- <line num="1915" type="stmt" count="0"/>
2891
- <line num="1916" type="stmt" count="0"/>
2892
- <line num="1918" type="stmt" count="0"/>
2893
- <line num="1920" type="stmt" count="0"/>
2894
- <line num="1924" type="stmt" count="0"/>
2895
- <line num="1925" type="stmt" count="0"/>
2896
- <line num="1926" type="stmt" count="0"/>
2897
- <line num="1928" type="stmt" count="0"/>
2898
  <line num="1929" type="stmt" count="0"/>
2899
- <line num="1930" type="stmt" count="0"/>
2900
- <line num="1932" type="stmt" count="0"/>
2901
- <line num="1934" type="stmt" count="0"/>
2902
- <line num="1938" type="stmt" count="0"/>
2903
- <line num="1939" type="stmt" count="0"/>
2904
- <line num="1943" type="stmt" count="0"/>
2905
- <line num="1946" type="stmt" count="0"/>
2906
- <line num="1948" type="stmt" count="0"/>
2907
- <line num="1949" type="stmt" count="0"/>
2908
- <line num="1950" type="stmt" count="0"/>
2909
- <line num="1952" type="stmt" count="0"/>
2910
- <line num="1954" type="stmt" count="0"/>
2911
- <line num="1959" type="stmt" count="0"/>
2912
- <line num="1960" type="stmt" count="0"/>
2913
- <line num="1961" type="stmt" count="0"/>
2914
- <line num="1964" type="stmt" count="0"/>
2915
  <line num="1966" type="stmt" count="0"/>
2916
  <line num="1967" type="stmt" count="0"/>
2917
- <line num="1968" type="stmt" count="0"/>
2918
- <line num="1970" type="stmt" count="0"/>
2919
- <line num="1972" type="stmt" count="0"/>
2920
  <line num="1977" type="stmt" count="0"/>
2921
  <line num="1978" type="stmt" count="0"/>
2922
  <line num="1979" type="stmt" count="0"/>
2923
- <line num="1981" type="stmt" count="0"/>
 
 
2924
  <line num="1984" type="stmt" count="0"/>
2925
- <line num="1985" type="stmt" count="0"/>
2926
  <line num="1986" type="stmt" count="0"/>
2927
- <line num="1987" type="stmt" count="0"/>
2928
- <line num="1989" type="stmt" count="0"/>
2929
- <line num="1990" type="stmt" count="0"/>
 
 
 
 
2930
  <line num="2000" type="stmt" count="0"/>
2931
- <line num="2003" type="stmt" count="0"/>
2932
- <line num="2016" type="method" name="get_dump_file" visibility="public" complexity="9" crap="25.08" count="1"/>
2933
- <line num="2018" type="stmt" count="1"/>
2934
- <line num="2019" type="stmt" count="0"/>
2935
- <line num="2039" type="stmt" count="1"/>
2936
- <line num="2040" type="stmt" count="1"/>
2937
- <line num="2041" type="stmt" count="1"/>
2938
- <line num="2042" type="stmt" count="1"/>
 
 
 
 
 
 
 
 
 
 
 
 
2939
  <line num="2046" type="stmt" count="0"/>
 
2940
  <line num="2049" type="stmt" count="0"/>
2941
  <line num="2052" type="stmt" count="0"/>
2942
  <line num="2053" type="stmt" count="0"/>
 
 
2943
  <line num="2057" type="stmt" count="0"/>
2944
  <line num="2058" type="stmt" count="0"/>
2945
- <line num="2059" type="method" name="anonymous function" complexity="3" crap="12" count="0"/>
2946
- <line num="2060" type="stmt" count="0"/>
2947
- <line num="2061" type="stmt" count="0"/>
2948
- <line num="2064" type="stmt" count="0"/>
2949
- <line num="2065" type="stmt" count="0"/>
2950
  <line num="2068" type="stmt" count="0"/>
2951
- <line num="2070" type="stmt" count="0"/>
2952
- <line num="2077" type="stmt" count="0"/>
2953
- <line num="2078" type="stmt" count="0"/>
2954
- <line num="2079" type="stmt" count="0"/>
2955
- <line num="2080" type="stmt" count="0"/>
2956
- <line num="2082" type="stmt" count="0"/>
2957
- <line num="2085" type="stmt" count="0"/>
2958
- <line num="2098" type="method" name="restore_archive_file" visibility="public" complexity="25" crap="44.07" count="1"/>
2959
- <line num="2099" type="stmt" count="1"/>
2960
- <line num="2102" type="stmt" count="1"/>
2961
- <line num="2103" type="stmt" count="0"/>
2962
  <line num="2107" type="stmt" count="1"/>
2963
- <line num="2108" type="stmt" count="0"/>
2964
- <line num="2112" type="stmt" count="1"/>
2965
- <line num="2113" type="stmt" count="1"/>
2966
- <line num="2116" type="stmt" count="1"/>
2967
- <line num="2117" type="stmt" count="1"/>
2968
- <line num="2118" type="stmt" count="1"/>
2969
- <line num="2119" type="stmt" count="0"/>
2970
- <line num="2123" type="stmt" count="1"/>
2971
- <line num="2124" type="stmt" count="1"/>
2972
- <line num="2125" type="stmt" count="1"/>
2973
  <line num="2126" type="stmt" count="0"/>
2974
- <line num="2130" type="stmt" count="1"/>
2975
- <line num="2132" type="stmt" count="1"/>
2976
- <line num="2133" type="stmt" count="1"/>
2977
- <line num="2134" type="stmt" count="0"/>
2978
- <line num="2137" type="stmt" count="1"/>
2979
- <line num="2139" type="stmt" count="1"/>
2980
- <line num="2140" type="stmt" count="0"/>
2981
- <line num="2143" type="stmt" count="1"/>
2982
- <line num="2145" type="stmt" count="1"/>
2983
- <line num="2146" type="stmt" count="1"/>
2984
- <line num="2147" type="stmt" count="1"/>
2985
  <line num="2148" type="stmt" count="0"/>
2986
- <line num="2153" type="stmt" count="1"/>
2987
- <line num="2154" type="stmt" count="1"/>
2988
- <line num="2155" type="stmt" count="1"/>
2989
- <line num="2156" type="stmt" count="1"/>
2990
- <line num="2157" type="stmt" count="1"/>
2991
- <line num="2158" type="stmt" count="1"/>
2992
- <line num="2159" type="stmt" count="1"/>
2993
- <line num="2160" type="stmt" count="1"/>
2994
- <line num="2163" type="stmt" count="1"/>
2995
- <line num="2165" type="stmt" count="1"/>
2996
- <line num="2174" type="stmt" count="1"/>
2997
  <line num="2180" type="stmt" count="1"/>
2998
- <line num="2181" type="stmt" count="0"/>
2999
  <line num="2184" type="stmt" count="1"/>
 
3000
  <line num="2186" type="stmt" count="1"/>
3001
  <line num="2187" type="stmt" count="0"/>
3002
- <line num="2197" type="stmt" count="0"/>
3003
- <line num="2199" type="stmt" count="0"/>
3004
- <line num="2200" type="stmt" count="0"/>
3005
- <line num="2201" type="stmt" count="0"/>
 
 
 
3006
  <line num="2202" type="stmt" count="0"/>
3007
- <line num="2203" type="stmt" count="0"/>
3008
- <line num="2205" type="stmt" count="0"/>
 
 
 
 
3009
  <line num="2215" type="stmt" count="1"/>
 
 
 
 
3010
  <line num="2224" type="stmt" count="1"/>
3011
  <line num="2225" type="stmt" count="1"/>
3012
  <line num="2226" type="stmt" count="1"/>
3013
- <line num="2229" type="stmt" count="1"/>
3014
- <line num="2230" type="stmt" count="0"/>
3015
- <line num="2231" type="stmt" count="0"/>
3016
  <line num="2233" type="stmt" count="1"/>
3017
- <line num="2234" type="stmt" count="0"/>
3018
- <line num="2236" type="stmt" count="0"/>
3019
- <line num="2237" type="stmt" count="0"/>
3020
- <line num="2238" type="stmt" count="0"/>
3021
- <line num="2239" type="stmt" count="0"/>
3022