PluginProbe
UpdraftPlus: WP Backup & Migration Plugin / 1.7.18
UpdraftPlus: WP Backup & Migration Plugin v1.7.18
1.26.7 1.26.6 1.26.5 1.26.4 1.26.3 1.9.19 1.9.25 1.9.26 1.9.30 1.9.31 1.9.32 1.9.4 1.9.40 1.9.41 1.9.42 1.9.43 1.9.44 1.9.45 1.9.46 1.9.5 1.9.50 1.9.51 1.9.60 1.9.62 1.9.63 All 371 releases
updraftplus / methods / email.php

email.php in UpdraftPlus: WP Backup & Migration Plugin 1.7.18, at methods/email.php

47 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Files can easily get way too big for this method
4
5 class UpdraftPlus_BackupModule_email {
6
7 public function backup($backup_array) {
8
9 global $updraftplus, $updraftplus_backup;
10
11 $updraft_dir = trailingslashit($updraftplus->backups_dir_location());
12
13 foreach ($backup_array as $type => $file) {
14 $fullpath = $updraft_dir.$file;
15 #if (file_exists($fullpath) && filesize($fullpath) > ...
16 $any_sent = false;
17 foreach (explode(',', UpdraftPlus_Options::get_updraft_option('updraft_email')) as $sendmail_addr) {
18 $send_short = (strlen($sendmail_addr)>5) ? substr($sendmail_addr, 0, 5).'...' : $sendmail_addr;
19 $updraftplus->log("$file: email to: $send_short");
20
21 $sent = wp_mail(trim($sendmail_addr), __("WordPress Backup",'updraftplus')." ".get_date_from_gmt(gmdate('Y-m-d H:i:s', $updraftplus->backup_time), 'Y-m-d H:i'), sprintf(__("Backup is of: %s.",'updraftplus'), $type).' '.__('Be wary; email backups may fail because of file size limitations on mail servers.','updraftplus'), null, array($fullpath));
22 if ($sent) $any_sent = true;
23 }
24 if ($any_sent) {
25 $updraftplus->uploaded_file($file);
26 } else {
27 $updraftplus->log('Mails were not sent successfully');
28 $updraftplus->log(__('The attempt to send the backup via email failed (probably the backup was too large for this method)', 'updraftplus'), 'error');
29 }
30 }
31 return null;
32 }
33
34 public static function config_print() {
35 ?>
36 <tr class="updraftplusmethod email">
37 <th><?php _e('Note:','updraftplus');?></th>
38 <td><?php echo str_replace('&gt;','>', str_replace('&lt;','<',htmlspecialchars(__('The email address entered above will be used. If choosing "E-Mail", then <strong>be aware</strong> that mail servers tend to have size limits; typically around 10-20Mb; backups larger than any limits will not arrive. If you really need a large backup via email, then you could fund a new feature (to break the backup set into configurable-size pieces) - but the demand has not yet existed for such a feature.','updraftplus'))));?></td>
39 </tr>
40 <?php
41 }
42
43 public function delete($files) {
44 }
45
46 }
47