PluginProbe
WP Database Backup – Unlimited Database & Files Backup by Backup for WP / 6.11
WP Database Backup – Unlimited Database & Files Backup by Backup for WP v6.11
7.13 7.12 trunk 1.1 2.1.1 5.9 6.0 6.1 6.10 6.11 6.12 6.12.1 6.2 6.3 6.4 6.5 6.5.1 6.6 6.7 6.8 6.9 7.0 7.0.1 7.1 7.10 All 34 releases
wp-database-backup / includes / log_generate.php

log_generate.php in WP Database Backup – Unlimited Database & Files Backup by Backup for WP 6.11, at includes/log_generate.php

47 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 add_action('wpdbbkp_backup_completed', array('WPDBFullBackupLog', 'wpdbbkp_backup_completed'), 11);
3
4 class WPDBFullBackupLog {
5
6 public static function wpdbbkp_backup_completed(&$args) {
7
8 $options = get_option('wp_db_backup_backups');
9 $newoptions = array();
10 $count = 0;
11
12 if(!empty($options) && is_array($options)){
13
14 foreach ($options as $option) {
15 if ($option['filename'] == $args[0]) {
16 $newoptions[] = $option;
17 $newoptions['destination'] = wp_kses($args[4]);
18 }else{
19 $newoptions[] = $option;
20 }
21 $count++;
22 }
23
24 }
25
26 update_option('wp_db_backup_backups', $newoptions, false);
27
28 if (get_option('wp_db_log') == 1) {
29 if(isset($args[4]) && !empty($args[4]))
30 {
31 if (is_writable($args[5]) || !file_exists($args[5])) {
32
33 if (!$handle = @fopen($args[5], 'a'))
34 return;
35
36 if (!fwrite($handle, str_replace("<br>", "\n", $args[2])))
37 return;
38
39 fclose($handle);
40
41 return true;
42 }
43 }
44 }
45 }
46
47 }