Version Description
Download this release
Release Info
Developer | DavidAnderson |
Plugin | UpdraftPlus WordPress Backup Plugin |
Version | 1.12.28 |
Comparing to | |
See all releases |
Code changes from version 1.12.25 to 1.12.28
- admin.php +89 -105
- backup.php +5 -2
- class-updraftplus.php +18 -55
- css/admin.css +1 -26
- css/updraftplus-notices.css +62 -0
- images/notices/black_friday.png +0 -0
- images/notices/christmas.png +0 -0
- images/notices/locksettings.png +0 -0
- images/notices/migrator.png +0 -0
- images/notices/multiplestorage_destinations.png +0 -0
- images/notices/new_year.png +0 -0
- images/notices/reporting.png +0 -0
- images/notices/spring.png +0 -0
- images/notices/summer.png +0 -0
- images/notices/support.png +0 -0
- images/notices/updraft_logo.png +0 -0
- includes/Dropbox2/API.php +4 -1
- includes/labelauty/LICENSE +20 -0
- includes/updraft-admin-ui.js +3 -0
- includes/updraftplus-notices.php +384 -0
- methods/dropbox.php +12 -7
- readme.txt +22 -4
- templates/wp-admin/notices/bottom-notice.php +40 -0
- templates/wp-admin/notices/horizontal-notice.php +52 -0
- templates/wp-admin/notices/report-plain.php +37 -0
- templates/wp-admin/notices/report.php +32 -0
- templates/wp-admin/notices/thanks-for-using-main-dash.php +23 -0
- updraftplus.php +1 -1
admin.php
CHANGED
@@ -278,7 +278,7 @@ class UpdraftPlus_Admin {
|
|
278 |
|
279 |
// Main dashboard page advert
|
280 |
// Since our nonce is printed, make sure they have sufficient credentials
|
281 |
-
if (
|
282 |
|
283 |
$dismissed_until = UpdraftPlus_Options::get_updraft_option('updraftplus_dismisseddashnotice', 0);
|
284 |
|
@@ -464,25 +464,7 @@ class UpdraftPlus_Admin {
|
|
464 |
// }
|
465 |
|
466 |
public function show_admin_notice_upgradead() {
|
467 |
-
|
468 |
-
<div id="updraft-dashnotice" class="updated">
|
469 |
-
<div style="float:right;"><a href="#" onclick="jQuery('#updraft-dashnotice').slideUp(); jQuery.post(ajaxurl, {action: 'updraft_ajax', subaction: 'dismissdashnotice', nonce: '<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>' });"><?php echo sprintf(__('Dismiss (for %s months)', 'updraftplus'), 12); ?></a></div>
|
470 |
-
|
471 |
-
<h3 class="thank-you"><?php _e('Thank you for backing up with UpdraftPlus!', 'updraftplus');?></h3>
|
472 |
-
|
473 |
-
<a href="<?php echo apply_filters('updraftplus_com_link','https://updraftplus.com/');?>"><img class="udp-logo" alt="UpdraftPlus" src="<?php echo UPDRAFTPLUS_URL.'/images/ud-logo-150.png' ?>"></a>
|
474 |
-
|
475 |
-
<?php
|
476 |
-
echo '<p><strong>'.__('Free Newsletter', 'updraftplus').'</strong> <br>'.__('UpdraftPlus news, high-quality training materials for WordPress developers and site-owners, and general WordPress news. You can de-subscribe at any time.', 'updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/newsletter-signup").'">'.__('Follow this link to sign up.', 'updraftplus').'</a></p>';
|
477 |
-
|
478 |
-
echo '<p><strong>'.__('UpdraftPlus Premium', 'updraftplus').'</strong> <br>'.__('For personal support, the ability to copy sites, more storage destinations, encrypted backups for security, multiple backup destinations, better reporting, no adverts and plenty more, take a look at the premium version of UpdraftPlus - the world’s most popular backup plugin.', 'updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/comparison-updraftplus-free-updraftplus-premium/").'">'.__('Compare with the free version', 'updraftplus').'</a> / <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/").'">'.__('Go to the shop.', 'updraftplus').'</a></p>';
|
479 |
-
|
480 |
-
echo '<p><strong>'.__('More Quality Plugins', 'updraftplus').'</strong> <br> <a href="https://wordpress.org/plugins/two-factor-authentication/">'.__('Free two-factor security plugin', 'updraftplus').'</a> | <a href="https://www.simbahosting.co.uk/s3/shop/">'.__('Premium WooCommerce plugins', 'updraftplus').'</a></p>';
|
481 |
-
?>
|
482 |
-
|
483 |
-
<div class="dismiss-dash-notice"><a href="#" onclick="jQuery('#updraft-dashnotice').slideUp(); jQuery.post(ajaxurl, {action: 'updraft_ajax', subaction: 'dismissdashnotice', nonce: '<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>' });"><?php echo sprintf(__('Dismiss (for %s months)', 'updraftplus'), 12); ?></a></div>
|
484 |
-
</div>
|
485 |
-
<?php
|
486 |
}
|
487 |
|
488 |
private function ensure_sufficient_jquery_and_enqueue() {
|
@@ -513,7 +495,7 @@ class UpdraftPlus_Admin {
|
|
513 |
wp_enqueue_style('jquery-ui', UPDRAFTPLUS_URL.'/includes/jquery-ui.custom.css', array(), '1.11.4');
|
514 |
|
515 |
$our_version = @constant('SCRIPT_DEBUG') ? $updraftplus->version.'.'.time() : $updraftplus->version;
|
516 |
-
|
517 |
wp_enqueue_style('updraft-admin-css', UPDRAFTPLUS_URL.'/css/admin.css', array(), $our_version);
|
518 |
// add_filter('style_loader_tag', array($this, 'style_loader_tag'), 10, 2);
|
519 |
|
@@ -577,7 +559,7 @@ class UpdraftPlus_Admin {
|
|
577 |
'delete_old_dirs' => __('Delete Old Directories', 'updraftplus'),
|
578 |
'raw' => __('Raw backup history', 'updraftplus'),
|
579 |
'notarchive' => __('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').' '.__('However, UpdraftPlus archives are standard zip/SQL files - so if you are sure that your file has the right format, then you can rename it to match that pattern.','updraftplus'),
|
580 |
-
'notarchive2' => '<p>'.__('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').'</p> '.apply_filters('updraftplus_if_foreign_then_premium_message', '<p><a href="'.apply_filters(
|
581 |
'makesure' => __('(make sure that you were trying to upload a zip file previously created by UpdraftPlus)','updraftplus'),
|
582 |
'uploaderror' => __('Upload error:','updraftplus'),
|
583 |
'notdba' => __('This file does not appear to be an UpdraftPlus encrypted database archive (such files are .gz.crypt files which have a name like: backup_(time)_(site name)_(code)_db.crypt.gz).','updraftplus'),
|
@@ -654,42 +636,35 @@ class UpdraftPlus_Admin {
|
|
654 |
|
655 |
// Despite the name, this fires irrespective of what capabilities the user has (even none - so be careful)
|
656 |
public function core_upgrade_preamble() {
|
657 |
-
|
658 |
// They need to be able to perform backups, and to perform updates
|
659 |
if (!UpdraftPlus_Options::user_can_manage() || (!current_user_can('update_core') && !current_user_can('update_plugins') && !current_user_can('update_themes'))) return;
|
660 |
|
661 |
if (!class_exists('UpdraftPlus_Addon_Autobackup')) {
|
662 |
if (defined('UPDRAFTPLUS_NOADS_B')) return;
|
663 |
-
$dismissed_until = UpdraftPlus_Options::get_updraft_option('updraftplus_dismissedautobackup', 0);
|
664 |
-
if ($dismissed_until > time()) return;
|
665 |
}
|
666 |
|
667 |
?>
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
<script>
|
675 |
jQuery(document).ready(function() {
|
676 |
-
jQuery('
|
677 |
});
|
678 |
</script>
|
679 |
<?php
|
680 |
}
|
681 |
-
|
682 |
-
private function autobackup_ad_content(){
|
683 |
-
global $updraftplus;
|
684 |
-
$our_version = @constant('SCRIPT_DEBUG') ? $updraftplus->version.'.'.time() : $updraftplus->version;
|
685 |
-
wp_enqueue_style('updraft-admin-css', UPDRAFTPLUS_URL.'/css/admin.css', array(), $our_version);
|
686 |
-
|
687 |
-
$ret = '<div class="autobackup-description"><img class="autobackup-image" src="'.UPDRAFTPLUS_URL.'/images/automaticbackup.png" class="automation-icon"/>';
|
688 |
-
$ret .= '<div class="advert-description">'.__('UpdraftPlus Premium can automatically take a backup of your plugins or themes and database before you update.', 'updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/autobackup/").'" target="_blank">'.__('Be safe every time, without needing to remember - follow this link to learn more', 'updraftplus').'</a></div></div>';
|
689 |
-
$ret .= '<div class="advert-btn"><a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/autobackup/").'" class="btn btn-get-started">'.__('Just this add-on', 'updraftplus').' <span class="circle-dblarrow">»</span></a></div>';
|
690 |
-
$ret .= '<div class="advert-btn"><a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/").'" class="btn btn-get-started">'.__('Full Premium plugin', 'updraftplus').' <span class="circle-dblarrow">»</span></a></div>';
|
691 |
-
return $ret;
|
692 |
-
}
|
693 |
|
694 |
public function admin_head() {
|
695 |
|
@@ -801,14 +776,13 @@ class UpdraftPlus_Admin {
|
|
801 |
array_unshift($links, $settings_link);
|
802 |
// $settings_link = '<a href="http://david.dw-perspective.org.uk/donate">'.__("Donate","UpdraftPlus").'</a>';
|
803 |
// array_unshift($links, $settings_link);
|
804 |
-
$settings_link = '<a href="'.apply_filters(
|
805 |
array_unshift($links, $settings_link);
|
806 |
}
|
807 |
return $links;
|
808 |
}
|
809 |
|
810 |
public function admin_action_upgrade_pluginortheme() {
|
811 |
-
|
812 |
if (isset($_GET['action']) && ($_GET['action'] == 'upgrade-plugin' || $_GET['action'] == 'upgrade-theme') && !class_exists('UpdraftPlus_Addon_Autobackup') && !defined('UPDRAFTPLUS_NOADS_B')) {
|
813 |
|
814 |
if ($_GET['action'] == 'upgrade-plugin') {
|
@@ -831,14 +805,10 @@ class UpdraftPlus_Admin {
|
|
831 |
}
|
832 |
|
833 |
require_once(ABSPATH.'wp-admin/admin-header.php');
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
<h3 style="margin-top: 0px;"><?php _e('Be safe with an automatic backup','updraftplus');?></h3>
|
839 |
-
<p><?php echo $this->autobackup_ad_content(); ?></p>
|
840 |
-
</div>
|
841 |
-
<?php
|
842 |
}
|
843 |
}
|
844 |
|
@@ -861,7 +831,7 @@ class UpdraftPlus_Admin {
|
|
861 |
}
|
862 |
|
863 |
public function show_admin_warning_disabledcron() {
|
864 |
-
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.__('The scheduler is disabled in your WordPress install, via the DISABLE_WP_CRON setting. No backups can run (even "Backup Now") unless either you have set up a facility to call the scheduler manually, or until it is enabled.','updraftplus').' <a href="'.apply_filters(
|
865 |
}
|
866 |
|
867 |
public function show_admin_warning_diskspace() {
|
@@ -873,7 +843,7 @@ class UpdraftPlus_Admin {
|
|
873 |
}
|
874 |
|
875 |
public function show_admin_warning_litespeed() {
|
876 |
-
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('Your website is hosted using the %s web server.','updraftplus'),'LiteSpeed').' <a href="'.apply_filters(
|
877 |
}
|
878 |
|
879 |
public function show_admin_debug_warning() {
|
@@ -882,7 +852,7 @@ class UpdraftPlus_Admin {
|
|
882 |
|
883 |
public function show_admin_warning_overdue_crons($howmany) {
|
884 |
$ret = '<div class="updraftmessage updated"><p>';
|
885 |
-
$ret .= '<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working.', 'updraftplus'), $howmany).' <a href="'.apply_filters(
|
886 |
$ret .= '</p></div>';
|
887 |
return $ret;
|
888 |
}
|
@@ -1310,6 +1280,10 @@ class UpdraftPlus_Admin {
|
|
1310 |
die;
|
1311 |
} elseif (isset($_REQUEST['subaction']) && 'dismissautobackup' == $_REQUEST['subaction']) {
|
1312 |
UpdraftPlus_Options::update_updraft_option('updraftplus_dismissedautobackup', time() + 84*86400);
|
|
|
|
|
|
|
|
|
1313 |
} elseif (isset($_REQUEST['subaction']) && 'set_autobackup_default' == $_REQUEST['subaction']) {
|
1314 |
// This option when set should have integers, not bools
|
1315 |
$default = empty($_REQUEST['default']) ? 0 : 1;
|
@@ -1780,15 +1754,23 @@ class UpdraftPlus_Admin {
|
|
1780 |
global $updraftplus;
|
1781 |
|
1782 |
if ($rescan) $messages = $updraftplus->rebuild_backup_history($remotescan);
|
1783 |
-
|
1784 |
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
|
1785 |
$backup_history = (is_array($backup_history)) ? $backup_history : array();
|
1786 |
$output = $this->existing_backup_table($backup_history);
|
|
|
1787 |
|
1788 |
if (!empty($messages) && is_array($messages)) {
|
1789 |
$noutput = '<div style="margin-left: 100px; margin-top: 10px;"><ul style="list-style: disc inside;">';
|
1790 |
foreach ($messages as $msg) {
|
1791 |
-
$noutput .= '<li>'.(($msg['desc']) ? $msg['desc'].': '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1792 |
}
|
1793 |
$noutput .= '</ul></div>';
|
1794 |
$output = $noutput.$output;
|
@@ -1803,6 +1785,7 @@ class UpdraftPlus_Admin {
|
|
1803 |
return apply_filters('updraftplus_get_history_status_result', array(
|
1804 |
'n' => sprintf(__('Existing Backups', 'updraftplus').' (%d)', count($backup_history)),
|
1805 |
't' => $output,
|
|
|
1806 |
'cksum' => md5($output),
|
1807 |
'logs_exist' => $logs_exist,
|
1808 |
));
|
@@ -2300,14 +2283,14 @@ class UpdraftPlus_Admin {
|
|
2300 |
<div class="wrap" id="updraft-wrap">
|
2301 |
<h1><?php echo $updraftplus->plugin_title; ?></h1>
|
2302 |
|
2303 |
-
<a href="<?php echo apply_filters(
|
2304 |
<?php if (!defined('UPDRAFTPLUS_NOADS_B')) { ?><a href="<?php echo apply_filters('updraftplus_com_link','https://updraftplus.com/shop/updraftplus-premium/');?>"><?php _e("Premium",'updraftplus');?></a> | <?php } ?>
|
2305 |
-
<a href="<?php echo apply_filters(
|
2306 |
<a href="https://twitter.com/updraftplus"><?php _e('Twitter', 'updraftplus');?></a> |
|
2307 |
-
<a href="<?php echo apply_filters(
|
2308 |
-
<?php if (!is_file(UPDRAFTPLUS_DIR.'/udaddons/updraftplus-addons.php')) { ?><a href="<?php echo apply_filters(
|
2309 |
<a href="http://david.dw-perspective.org.uk"><?php _e("Lead developer's homepage",'updraftplus');?></a> |
|
2310 |
-
<a href="<?php echo apply_filters(
|
2311 |
<br>
|
2312 |
<?php
|
2313 |
}
|
@@ -2468,7 +2451,7 @@ class UpdraftPlus_Admin {
|
|
2468 |
<?php if (false !== strpos(basename(UPDRAFTPLUS_URL), ' ')) { ?>
|
2469 |
<strong><?php _e('The UpdraftPlus directory in wp-content/plugins has white-space in it; WordPress does not like this. You should rename the directory to wp-content/plugins/updraftplus to fix this problem.', 'updraftplus');?></strong>
|
2470 |
<?php } else { ?>
|
2471 |
-
<a href="<?php echo apply_filters(
|
2472 |
<?php } ?>
|
2473 |
</p>
|
2474 |
</div>
|
@@ -2500,16 +2483,19 @@ class UpdraftPlus_Admin {
|
|
2500 |
// Close the div opened by the earlier section
|
2501 |
if (isset($_GET['updraft_restore_success'])) echo '</div>';
|
2502 |
|
2503 |
-
$
|
2504 |
-
|
|
|
|
|
2505 |
|
2506 |
if (!$updraftplus->memory_check(64)) {
|
2507 |
-
|
2508 |
-
|
2509 |
-
|
2510 |
-
|
2511 |
-
|
2512 |
-
|
|
|
2513 |
|
2514 |
if (!empty($updraftplus->errors)) {
|
2515 |
echo '<div class="error updraft_list_errors">';
|
@@ -2624,7 +2610,7 @@ class UpdraftPlus_Admin {
|
|
2624 |
if (class_exists('UpdraftPlus_Addons_Migrator')) {
|
2625 |
do_action('updraftplus_migrate_modal_output');
|
2626 |
} else {
|
2627 |
-
echo '<p id="updraft_migrate_modal_main">'.__('Do you want to migrate or clone/duplicate a site?', 'updraftplus').'</p><p>'.__('Then, try out our "Migrator" add-on. After using it once, you\'ll have saved the purchase price compared to the time needed to copy a site by hand.', 'updraftplus').'</p><p><a href="'.apply_filters(
|
2628 |
}
|
2629 |
?>
|
2630 |
</div>
|
@@ -2655,7 +2641,7 @@ class UpdraftPlus_Admin {
|
|
2655 |
<table>
|
2656 |
<tr>
|
2657 |
<td>
|
2658 |
-
<p class="multisite-advert-width"><?php echo __('Do you need WordPress Multisite support?','updraftplus').' <a href="'.apply_filters(
|
2659 |
</td>
|
2660 |
</tr>
|
2661 |
</table>
|
@@ -2698,12 +2684,12 @@ class UpdraftPlus_Admin {
|
|
2698 |
<div>
|
2699 |
<h2>UpdraftPlus Premium</h2>
|
2700 |
<p>
|
2701 |
-
<span class="premium-upgrade-prompt"><?php _e('You are currently using the free version of UpdraftPlus from wordpress.org.', 'updraftplus');?> <a href="<?php echo apply_filters(
|
2702 |
<ul class="updraft_premium_description_list">
|
2703 |
-
<li><a href="<?php echo apply_filters(
|
2704 |
-
<li><a href="<?php echo apply_filters(
|
2705 |
-
<li><a href="<?php echo apply_filters(
|
2706 |
-
<li class="last"><a href="<?php echo apply_filters(
|
2707 |
</ul>
|
2708 |
</p>
|
2709 |
</div>
|
@@ -2712,14 +2698,14 @@ class UpdraftPlus_Admin {
|
|
2712 |
<tr>
|
2713 |
<th class="updraft_feat_th" style="text-align:left;"></th>
|
2714 |
<th class="updraft_feat_th"><img src="<?php echo $freev;?>" height="120"></th>
|
2715 |
-
<th class="updraft_feat_th" style='background-color:#DF6926;'><a href="<?php echo apply_filters(
|
2716 |
</tr>
|
2717 |
<tr>
|
2718 |
<td class="updraft_feature_cell"><?php _e('Get it from', 'updraftplus');?></td>
|
2719 |
<td class="updraft_tick_cell" style="vertical-align:top; line-height: 120%; margin-top:6px; padding-top:6px;">WordPress.Org</td>
|
2720 |
<td class="updraft_tick_cell" style="padding: 6px; line-height: 120%;">
|
2721 |
UpdraftPlus.Com<br>
|
2722 |
-
<a href="<?php echo apply_filters(
|
2723 |
</td>
|
2724 |
</tr>
|
2725 |
<tr>
|
@@ -3012,7 +2998,7 @@ class UpdraftPlus_Admin {
|
|
3012 |
<?php /* echo '<h2>'.__('Existing Backups: Downloading And Restoring', 'updraftplus').'</h2>'; */ ?>
|
3013 |
<?php if (!empty($options['include_whitespace_warning'])) { ?>
|
3014 |
<p class="ud-whitespace-warning updraft-hidden" style="display:none;">
|
3015 |
-
<?php echo '<strong>'.__('Warning','updraftplus').':</strong> '.__('Your WordPress installation has a problem with outputting extra whitespace. This can corrupt backups that you download from here.','updraftplus').' <a href="'.apply_filters(
|
3016 |
</p>
|
3017 |
<?php } ?>
|
3018 |
|
@@ -3133,7 +3119,7 @@ class UpdraftPlus_Admin {
|
|
3133 |
|
3134 |
# The 'off' check is for badly configured setups - http://wordpress.org/support/topic/plugin-wp-super-cache-warning-php-safe-mode-enabled-but-safe-mode-is-off
|
3135 |
if ($updraftplus->detect_safe_mode()) {
|
3136 |
-
echo "<p><em>".__("Your web server has PHP's so-called safe_mode active.", 'updraftplus').' '.__('This makes time-outs much more likely. You are recommended to turn safe_mode off, or to restore only one entity at a time', 'updraftplus').' <a href="'.apply_filters(
|
3137 |
}
|
3138 |
|
3139 |
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
|
@@ -3161,7 +3147,7 @@ class UpdraftPlus_Admin {
|
|
3161 |
|
3162 |
if (!class_exists('UpdraftPlus_Addons_Migrator')) {
|
3163 |
|
3164 |
-
echo '<a href="'.apply_filters(
|
3165 |
|
3166 |
}
|
3167 |
|
@@ -3172,7 +3158,7 @@ class UpdraftPlus_Admin {
|
|
3172 |
</div>
|
3173 |
</fieldset>
|
3174 |
</form>
|
3175 |
-
<p><em><a href="<?php echo apply_filters(
|
3176 |
</div>
|
3177 |
</div>
|
3178 |
|
@@ -3754,7 +3740,7 @@ class UpdraftPlus_Admin {
|
|
3754 |
<th><?php _e('Incremental file backup schedule', 'updraftplus'); ?>:</th>
|
3755 |
<td>
|
3756 |
<?php do_action('updraftplus_incremental_cell', $selected_interval); ?>
|
3757 |
-
<a href="<?php echo apply_filters(
|
3758 |
</td>
|
3759 |
</tr>
|
3760 |
<?php } ?>
|
@@ -3790,7 +3776,7 @@ class UpdraftPlus_Admin {
|
|
3790 |
<th></th>
|
3791 |
<td><div>
|
3792 |
<?php
|
3793 |
-
echo apply_filters('updraftplus_fixtime_ftinfo', '<p>'.__('To fix the time at which a backup should take place,','updraftplus').' ('.__('e.g. if your server is busy at day and you want to run overnight','updraftplus').'), '.__('or to configure more complex schedules', 'updraftplus').', <a href="'.apply_filters(
|
3794 |
?>
|
3795 |
</div></td>
|
3796 |
</tr>
|
@@ -3830,7 +3816,7 @@ class UpdraftPlus_Admin {
|
|
3830 |
if (false === apply_filters('updraftplus_storage_printoptions', false, $active_service)) {
|
3831 |
|
3832 |
echo '</div>';
|
3833 |
-
echo '<p><a href="'.apply_filters(
|
3834 |
echo '</td></tr>';
|
3835 |
}
|
3836 |
?>
|
@@ -3864,7 +3850,7 @@ class UpdraftPlus_Admin {
|
|
3864 |
<th><?php _e('Include in files backup', 'updraftplus');?>:</th>
|
3865 |
<td>
|
3866 |
<?php echo $this->files_selector_widgetry(); ?>
|
3867 |
-
<p><?php echo apply_filters('updraftplus_admin_directories_description', __('The above directories are everything, except for WordPress core itself which you can download afresh from WordPress.org.', 'updraftplus').' <a href="'.apply_filters(
|
3868 |
</td>
|
3869 |
</tr>
|
3870 |
</table>
|
@@ -3878,7 +3864,7 @@ class UpdraftPlus_Admin {
|
|
3878 |
|
3879 |
<td>
|
3880 |
<?php
|
3881 |
-
echo apply_filters('updraft_database_encryption_config', '<a href="'.apply_filters(
|
3882 |
?>
|
3883 |
</td>
|
3884 |
</tr>
|
@@ -3960,7 +3946,7 @@ class UpdraftPlus_Admin {
|
|
3960 |
?>
|
3961 |
<input type="checkbox" id="updraft_email" name="updraft_email" value="<?php esc_attr_e(get_bloginfo('admin_email')); ?>"<?php if (!empty($updraft_email)) echo ' checked="checked"';?> > <br><label for="updraft_email"><?php echo __("Check this box to have a basic report sent to", 'updraftplus').' <a href="'.admin_url('options-general.php').'">'.__("your site's admin address", 'updraftplus').'</a> ('.htmlspecialchars(get_bloginfo('admin_email')).")."; ?></label>
|
3962 |
<?php
|
3963 |
-
if (!class_exists('UpdraftPlus_Addon_Reporting')) echo '<a href="'.apply_filters(
|
3964 |
?>
|
3965 |
</td>
|
3966 |
</tr>
|
@@ -4036,22 +4022,20 @@ class UpdraftPlus_Admin {
|
|
4036 |
|
4037 |
<tr class="expertmode updraft-hidden" style="display:none;">
|
4038 |
<th><?php _e('Disable SSL entirely where possible', 'updraftplus');?>:</th>
|
4039 |
-
<td><input data-updraft_settings_test="nossl" type="checkbox" id="updraft_ssl_nossl" name="updraft_ssl_nossl" value="1" <?php if (UpdraftPlus_Options::get_updraft_option('updraft_ssl_nossl')) echo 'checked="checked"'; ?>> <br><label for="updraft_ssl_nossl"><?php _e('Choosing this option lowers your security by stopping UpdraftPlus from using SSL for authentication and encrypted transport at all, where possible. Note that some cloud storage providers do not allow this (e.g. Dropbox), so with those providers this setting will have no effect.','updraftplus');?> <a href="<?php echo apply_filters(
|
4040 |
</tr>
|
4041 |
|
4042 |
<?php do_action('updraftplus_configprint_expertoptions'); ?>
|
4043 |
|
4044 |
<tr>
|
4045 |
-
|
4046 |
-
|
4047 |
-
|
4048 |
-
|
4049 |
-
|
|
|
|
|
4050 |
?>
|
4051 |
-
<p class="wordshell-advert">
|
4052 |
-
<?php echo $ws_ad; ?>
|
4053 |
-
</p>
|
4054 |
-
<?php } ?>
|
4055 |
</td>
|
4056 |
</tr>
|
4057 |
<?php if (!empty($options['include_save_button'])) { ?>
|
@@ -4719,7 +4703,7 @@ ENDHERE;
|
|
4719 |
$credentials = request_filesystem_credentials(UpdraftPlus_Options::admin_page()."?page=updraftplus&action=updraft_restore&backup_timestamp=$timestamp", '', false, false, $extra_fields);
|
4720 |
WP_Filesystem($credentials);
|
4721 |
if ( $wp_filesystem->errors->get_error_code() ) {
|
4722 |
-
echo '<p><em><a href="'.apply_filters(
|
4723 |
foreach ( $wp_filesystem->errors->get_error_messages() as $message ) show_message($message);
|
4724 |
exit;
|
4725 |
}
|
@@ -5016,7 +5000,7 @@ ENDHERE;
|
|
5016 |
$pdata = (is_string($data)) ? $data : serialize($data);
|
5017 |
$updraftplus->log(__('Error data:', 'updraftplus').' '.$pdata, 'warning-restore');
|
5018 |
if (false !== strpos($pdata, 'PCLZIP_ERR_BAD_FORMAT (-10)')) {
|
5019 |
-
echo '<a href="'.apply_filters(
|
5020 |
}
|
5021 |
}
|
5022 |
}
|
@@ -5154,7 +5138,7 @@ ENDHERE;
|
|
5154 |
$no_remote_configured = (empty($service) || array('none') === $service || array('') === $service) ? true : false;
|
5155 |
|
5156 |
if ($no_remote_configured) {
|
5157 |
-
return '<input type="checkbox" disabled="disabled" id="backupnow_includecloud"> <em>'.sprintf(__("Backup won't be sent to any remote storage - none has been saved in the %s", 'updraftplus'), '<a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&tab=settings" id="updraft_backupnow_gotosettings">'.__('settings', 'updraftplus')).'</a>. '.__('Not got any remote storage?', 'updraftplus').' <a href="'.apply_filters(
|
5158 |
} else {
|
5159 |
return '<input type="checkbox" id="backupnow_includecloud" checked="checked"> <label for="backupnow_includecloud">'.__("Send this backup to remote storage", 'updraftplus').'</label>';
|
5160 |
}
|
278 |
|
279 |
// Main dashboard page advert
|
280 |
// Since our nonce is printed, make sure they have sufficient credentials
|
281 |
+
if ($pagenow == 'index.php' && current_user_can('update_plugins') && (!file_exists(UPDRAFTPLUS_DIR.'/udaddons') || (defined('UPDRAFTPLUS_FORCE_DASHNOTICE') && UPDRAFTPLUS_FORCE_DASHNOTICE))) {
|
282 |
|
283 |
$dismissed_until = UpdraftPlus_Options::get_updraft_option('updraftplus_dismisseddashnotice', 0);
|
284 |
|
464 |
// }
|
465 |
|
466 |
public function show_admin_notice_upgradead() {
|
467 |
+
$this->include_template('wp-admin/notices/thanks-for-using-main-dash.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
}
|
469 |
|
470 |
private function ensure_sufficient_jquery_and_enqueue() {
|
495 |
wp_enqueue_style('jquery-ui', UPDRAFTPLUS_URL.'/includes/jquery-ui.custom.css', array(), '1.11.4');
|
496 |
|
497 |
$our_version = @constant('SCRIPT_DEBUG') ? $updraftplus->version.'.'.time() : $updraftplus->version;
|
498 |
+
|
499 |
wp_enqueue_style('updraft-admin-css', UPDRAFTPLUS_URL.'/css/admin.css', array(), $our_version);
|
500 |
// add_filter('style_loader_tag', array($this, 'style_loader_tag'), 10, 2);
|
501 |
|
559 |
'delete_old_dirs' => __('Delete Old Directories', 'updraftplus'),
|
560 |
'raw' => __('Raw backup history', 'updraftplus'),
|
561 |
'notarchive' => __('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').' '.__('However, UpdraftPlus archives are standard zip/SQL files - so if you are sure that your file has the right format, then you can rename it to match that pattern.','updraftplus'),
|
562 |
+
'notarchive2' => '<p>'.__('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').'</p> '.apply_filters('updraftplus_if_foreign_then_premium_message', '<p><a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/shop/updraftplus-premium/").'">'.__('If this is a backup created by a different backup plugin, then UpdraftPlus Premium may be able to help you.', 'updraftplus').'</a></p>'),
|
563 |
'makesure' => __('(make sure that you were trying to upload a zip file previously created by UpdraftPlus)','updraftplus'),
|
564 |
'uploaderror' => __('Upload error:','updraftplus'),
|
565 |
'notdba' => __('This file does not appear to be an UpdraftPlus encrypted database archive (such files are .gz.crypt files which have a name like: backup_(time)_(site name)_(code)_db.crypt.gz).','updraftplus'),
|
636 |
|
637 |
// Despite the name, this fires irrespective of what capabilities the user has (even none - so be careful)
|
638 |
public function core_upgrade_preamble() {
|
|
|
639 |
// They need to be able to perform backups, and to perform updates
|
640 |
if (!UpdraftPlus_Options::user_can_manage() || (!current_user_can('update_core') && !current_user_can('update_plugins') && !current_user_can('update_themes'))) return;
|
641 |
|
642 |
if (!class_exists('UpdraftPlus_Addon_Autobackup')) {
|
643 |
if (defined('UPDRAFTPLUS_NOADS_B')) return;
|
|
|
|
|
644 |
}
|
645 |
|
646 |
?>
|
647 |
+
<?php
|
648 |
+
if (!class_exists('UpdraftPlus_Addon_Autobackup')) {
|
649 |
+
|
650 |
+
if (!class_exists('UpdraftPlus_Notices')) require_once(UPDRAFTPLUS_DIR.'/includes/updraftplus-notices.php');
|
651 |
+
|
652 |
+
echo apply_filters('updraftplus_autobackup_blurb', UpdraftPlus_Notices::do_notice('autobackup', 'autobackup', true));
|
653 |
+
|
654 |
+
} else {
|
655 |
+
echo '<div class="updraft-ad-container updated">';
|
656 |
+
echo '<h3 style="margin-top: 2px;">'. __('Be safe with an automatic backup','updraftplus').'</h3>';
|
657 |
+
echo apply_filters('updraftplus_autobackup_blurb', '');
|
658 |
+
echo '</div>';
|
659 |
+
}
|
660 |
+
?>
|
661 |
<script>
|
662 |
jQuery(document).ready(function() {
|
663 |
+
jQuery('.updraft-ad-container').appendTo('.wrap p:first');
|
664 |
});
|
665 |
</script>
|
666 |
<?php
|
667 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
668 |
|
669 |
public function admin_head() {
|
670 |
|
776 |
array_unshift($links, $settings_link);
|
777 |
// $settings_link = '<a href="http://david.dw-perspective.org.uk/donate">'.__("Donate","UpdraftPlus").'</a>';
|
778 |
// array_unshift($links, $settings_link);
|
779 |
+
$settings_link = '<a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/").'">'.__("Add-Ons / Pro Support","updraftplus").'</a>';
|
780 |
array_unshift($links, $settings_link);
|
781 |
}
|
782 |
return $links;
|
783 |
}
|
784 |
|
785 |
public function admin_action_upgrade_pluginortheme() {
|
|
|
786 |
if (isset($_GET['action']) && ($_GET['action'] == 'upgrade-plugin' || $_GET['action'] == 'upgrade-theme') && !class_exists('UpdraftPlus_Addon_Autobackup') && !defined('UPDRAFTPLUS_NOADS_B')) {
|
787 |
|
788 |
if ($_GET['action'] == 'upgrade-plugin') {
|
805 |
}
|
806 |
|
807 |
require_once(ABSPATH.'wp-admin/admin-header.php');
|
808 |
+
|
809 |
+
if (!class_exists('UpdraftPlus_Notices')) require_once(UPDRAFTPLUS_DIR.'/includes/updraftplus-notices.php');
|
810 |
+
|
811 |
+
UpdraftPlus_Notices::do_notice('autobackup', 'autobackup');
|
|
|
|
|
|
|
|
|
812 |
}
|
813 |
}
|
814 |
|
831 |
}
|
832 |
|
833 |
public function show_admin_warning_disabledcron() {
|
834 |
+
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.__('The scheduler is disabled in your WordPress install, via the DISABLE_WP_CRON setting. No backups can run (even "Backup Now") unless either you have set up a facility to call the scheduler manually, or until it is enabled.','updraftplus').' <a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/#disablewpcron/").'">'.__('Go here for more information.','updraftplus').'</a>', 'updated updraftplus-disable-wp-cron-warning');
|
835 |
}
|
836 |
|
837 |
public function show_admin_warning_diskspace() {
|
843 |
}
|
844 |
|
845 |
public function show_admin_warning_litespeed() {
|
846 |
+
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('Your website is hosted using the %s web server.','updraftplus'),'LiteSpeed').' <a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/i-am-having-trouble-backing-up-and-my-web-hosting-company-uses-the-litespeed-webserver/").'">'.__('Please consult this FAQ if you have problems backing up.', 'updraftplus').'</a>');
|
847 |
}
|
848 |
|
849 |
public function show_admin_debug_warning() {
|
852 |
|
853 |
public function show_admin_warning_overdue_crons($howmany) {
|
854 |
$ret = '<div class="updraftmessage updated"><p>';
|
855 |
+
$ret .= '<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working.', 'updraftplus'), $howmany).' <a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/scheduler-wordpress-installation-working/").'">'.__('Read this page for a guide to possible causes and how to fix it.', 'updraftplus').'</a>';
|
856 |
$ret .= '</p></div>';
|
857 |
return $ret;
|
858 |
}
|
1280 |
die;
|
1281 |
} elseif (isset($_REQUEST['subaction']) && 'dismissautobackup' == $_REQUEST['subaction']) {
|
1282 |
UpdraftPlus_Options::update_updraft_option('updraftplus_dismissedautobackup', time() + 84*86400);
|
1283 |
+
} elseif (isset($_REQUEST['subaction']) && 'dismiss_notice' == $_REQUEST['subaction']) {
|
1284 |
+
UpdraftPlus_Options::update_updraft_option('dismissed_general_notices_until', time() + 84*86400);
|
1285 |
+
} elseif (isset($_REQUEST['subaction']) && 'dismiss_season' == $_REQUEST['subaction']) {
|
1286 |
+
UpdraftPlus_Options::update_updraft_option('dismissed_season_notices_until', time() + 366*86400);
|
1287 |
} elseif (isset($_REQUEST['subaction']) && 'set_autobackup_default' == $_REQUEST['subaction']) {
|
1288 |
// This option when set should have integers, not bools
|
1289 |
$default = empty($_REQUEST['default']) ? 0 : 1;
|
1754 |
global $updraftplus;
|
1755 |
|
1756 |
if ($rescan) $messages = $updraftplus->rebuild_backup_history($remotescan);
|
|
|
1757 |
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
|
1758 |
$backup_history = (is_array($backup_history)) ? $backup_history : array();
|
1759 |
$output = $this->existing_backup_table($backup_history);
|
1760 |
+
$data = array();
|
1761 |
|
1762 |
if (!empty($messages) && is_array($messages)) {
|
1763 |
$noutput = '<div style="margin-left: 100px; margin-top: 10px;"><ul style="list-style: disc inside;">';
|
1764 |
foreach ($messages as $msg) {
|
1765 |
+
$noutput .= '<li>'.(empty($msg['desc']) ? '' : $msg['desc'].': ').'<em>'.$msg['message'].'</em></li>';
|
1766 |
+
if (!empty($msg['data'])) {
|
1767 |
+
if (!empty($msg['desc'])) {
|
1768 |
+
$data['desc'] = $msg['data'];
|
1769 |
+
} else {
|
1770 |
+
// At the time of authorship, this code branch is not known to be used
|
1771 |
+
$data[] = $msg['data'];
|
1772 |
+
}
|
1773 |
+
}
|
1774 |
}
|
1775 |
$noutput .= '</ul></div>';
|
1776 |
$output = $noutput.$output;
|
1785 |
return apply_filters('updraftplus_get_history_status_result', array(
|
1786 |
'n' => sprintf(__('Existing Backups', 'updraftplus').' (%d)', count($backup_history)),
|
1787 |
't' => $output,
|
1788 |
+
'data' => $data,
|
1789 |
'cksum' => md5($output),
|
1790 |
'logs_exist' => $logs_exist,
|
1791 |
));
|
2283 |
<div class="wrap" id="updraft-wrap">
|
2284 |
<h1><?php echo $updraftplus->plugin_title; ?></h1>
|
2285 |
|
2286 |
+
<a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/");?>">UpdraftPlus.Com</a> |
|
2287 |
<?php if (!defined('UPDRAFTPLUS_NOADS_B')) { ?><a href="<?php echo apply_filters('updraftplus_com_link','https://updraftplus.com/shop/updraftplus-premium/');?>"><?php _e("Premium",'updraftplus');?></a> | <?php } ?>
|
2288 |
+
<a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/news/");?>"><?php _e('News','updraftplus');?></a> |
|
2289 |
<a href="https://twitter.com/updraftplus"><?php _e('Twitter', 'updraftplus');?></a> |
|
2290 |
+
<a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/support/");?>"><?php _e("Support",'updraftplus');?></a> |
|
2291 |
+
<?php if (!is_file(UPDRAFTPLUS_DIR.'/udaddons/updraftplus-addons.php')) { ?><a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/newsletter-signup");?>"><?php _e("Newsletter sign-up", 'updraftplus');?></a> | <?php } ?>
|
2292 |
<a href="http://david.dw-perspective.org.uk"><?php _e("Lead developer's homepage",'updraftplus');?></a> |
|
2293 |
+
<a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/support/frequently-asked-questions/");?>"><?php _e('FAQs', 'updraftplus'); ?></a> | <a href="https://www.simbahosting.co.uk/s3/shop/"><?php _e('More plugins', 'updraftplus');?></a> - <?php _e('Version','updraftplus');?>: <?php echo $updraftplus->version; ?>
|
2294 |
<br>
|
2295 |
<?php
|
2296 |
}
|
2451 |
<?php if (false !== strpos(basename(UPDRAFTPLUS_URL), ' ')) { ?>
|
2452 |
<strong><?php _e('The UpdraftPlus directory in wp-content/plugins has white-space in it; WordPress does not like this. You should rename the directory to wp-content/plugins/updraftplus to fix this problem.', 'updraftplus');?></strong>
|
2453 |
<?php } else { ?>
|
2454 |
+
<a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/do-you-have-a-javascript-or-jquery-error/");?>"><?php _e('Go here for more information.', 'updraftplus'); ?></a>
|
2455 |
<?php } ?>
|
2456 |
</p>
|
2457 |
</div>
|
2483 |
// Close the div opened by the earlier section
|
2484 |
if (isset($_GET['updraft_restore_success'])) echo '</div>';
|
2485 |
|
2486 |
+
if(empty($success_advert) && empty($this->no_settings_warning)) {
|
2487 |
+
if (!class_exists('UpdraftPlus_Notices')) require_once(UPDRAFTPLUS_DIR.'/includes/updraftplus-notices.php');
|
2488 |
+
UpdraftPlus_Notices::do_notice();
|
2489 |
+
}
|
2490 |
|
2491 |
if (!$updraftplus->memory_check(64)) {
|
2492 |
+
// HS8390 - A case where UpdraftPlus::memory_check_current() returns -1
|
2493 |
+
$memory_check_current = $updraftplus->memory_check_current();
|
2494 |
+
if ($memory_check_current > 0) { ?>
|
2495 |
+
<div class="updated memory-limit"><?php _e('Your PHP memory limit (set by your web hosting company) is very low. UpdraftPlus attempted to raise it but was unsuccessful. This plugin may struggle with a memory limit of less than 64 Mb - especially if you have very large files uploaded (though on the other hand, many sites will be successful with a 32Mb limit - your experience may vary).', 'updraftplus');?> <?php _e('Current limit is:', 'updraftplus');?> <?php echo $updraftplus->memory_check_current(); ?> MB</div>
|
2496 |
+
<?php }
|
2497 |
+
}
|
2498 |
+
|
2499 |
|
2500 |
if (!empty($updraftplus->errors)) {
|
2501 |
echo '<div class="error updraft_list_errors">';
|
2610 |
if (class_exists('UpdraftPlus_Addons_Migrator')) {
|
2611 |
do_action('updraftplus_migrate_modal_output');
|
2612 |
} else {
|
2613 |
+
echo '<p id="updraft_migrate_modal_main">'.__('Do you want to migrate or clone/duplicate a site?', 'updraftplus').'</p><p>'.__('Then, try out our "Migrator" add-on which can perform a direct site-to-site migration. After using it once, you\'ll have saved the purchase price compared to the time needed to copy a site by hand.', 'updraftplus').'</p><p><a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/landing/migrator/").'">'.__('Get it here.', 'updraftplus').'</a></p>';
|
2614 |
}
|
2615 |
?>
|
2616 |
</div>
|
2641 |
<table>
|
2642 |
<tr>
|
2643 |
<td>
|
2644 |
+
<p class="multisite-advert-width"><?php echo __('Do you need WordPress Multisite support?','updraftplus').' <a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/shop/updraftplus-premium/").'">'. __('Please check out UpdraftPlus Premium, or the stand-alone Multisite add-on.','updraftplus');?></a>.</p>
|
2645 |
</td>
|
2646 |
</tr>
|
2647 |
</table>
|
2684 |
<div>
|
2685 |
<h2>UpdraftPlus Premium</h2>
|
2686 |
<p>
|
2687 |
+
<span class="premium-upgrade-prompt"><?php _e('You are currently using the free version of UpdraftPlus from wordpress.org.', 'updraftplus');?> <a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/support/installing-updraftplus-premium-your-add-on/");?>"><br><?php echo __('If you have made a purchase from UpdraftPlus.Com, then follow this link to the instructions to install your purchase.', 'updraftplus').' '.__('The first step is to de-install the free version.', 'updraftplus')?></a></span>
|
2688 |
<ul class="updraft_premium_description_list">
|
2689 |
+
<li><a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/shop/updraftplus-premium/");?>"><strong><?php _e('Get UpdraftPlus Premium', 'updraftplus');?></strong></a></li>
|
2690 |
+
<li><a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/updraftplus-full-feature-list/");?>"><?php _e('Full feature list', 'updraftplus');?></a></li>
|
2691 |
+
<li><a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/faq-category/general-and-pre-sales-questions/");?>"><?php _e('Pre-sales FAQs', 'updraftplus');?></a></li>
|
2692 |
+
<li class="last"><a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/ask-a-pre-sales-question/");?>"><?php _e('Ask a pre-sales question', 'updraftplus');?></a> - <a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/support/");?>"><?php _e('Support', 'updraftplus');?></a></li>
|
2693 |
</ul>
|
2694 |
</p>
|
2695 |
</div>
|
2698 |
<tr>
|
2699 |
<th class="updraft_feat_th" style="text-align:left;"></th>
|
2700 |
<th class="updraft_feat_th"><img src="<?php echo $freev;?>" height="120"></th>
|
2701 |
+
<th class="updraft_feat_th" style='background-color:#DF6926;'><a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/shop/updraftplus-premium/");?>"><img src="<?php echo $premv;?>" height="120"></a></th>
|
2702 |
</tr>
|
2703 |
<tr>
|
2704 |
<td class="updraft_feature_cell"><?php _e('Get it from', 'updraftplus');?></td>
|
2705 |
<td class="updraft_tick_cell" style="vertical-align:top; line-height: 120%; margin-top:6px; padding-top:6px;">WordPress.Org</td>
|
2706 |
<td class="updraft_tick_cell" style="padding: 6px; line-height: 120%;">
|
2707 |
UpdraftPlus.Com<br>
|
2708 |
+
<a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/shop/updraftplus-premium/");?>"><strong><?php _e('Buy It Now!', 'updraftplus');?></strong></a><br>
|
2709 |
</td>
|
2710 |
</tr>
|
2711 |
<tr>
|
2998 |
<?php /* echo '<h2>'.__('Existing Backups: Downloading And Restoring', 'updraftplus').'</h2>'; */ ?>
|
2999 |
<?php if (!empty($options['include_whitespace_warning'])) { ?>
|
3000 |
<p class="ud-whitespace-warning updraft-hidden" style="display:none;">
|
3001 |
+
<?php echo '<strong>'.__('Warning','updraftplus').':</strong> '.__('Your WordPress installation has a problem with outputting extra whitespace. This can corrupt backups that you download from here.','updraftplus').' <a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/problems-with-extra-white-space/").'">'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</a>';?>
|
3002 |
</p>
|
3003 |
<?php } ?>
|
3004 |
|
3119 |
|
3120 |
# The 'off' check is for badly configured setups - http://wordpress.org/support/topic/plugin-wp-super-cache-warning-php-safe-mode-enabled-but-safe-mode-is-off
|
3121 |
if ($updraftplus->detect_safe_mode()) {
|
3122 |
+
echo "<p><em>".__("Your web server has PHP's so-called safe_mode active.", 'updraftplus').' '.__('This makes time-outs much more likely. You are recommended to turn safe_mode off, or to restore only one entity at a time', 'updraftplus').' <a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/i-want-to-restore-but-have-either-cannot-or-have-failed-to-do-so-from-the-wp-admin-console/").'">'.__('or to restore manually', 'updraftplus').'.</a></em></p><br>';
|
3123 |
}
|
3124 |
|
3125 |
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
|
3147 |
|
3148 |
if (!class_exists('UpdraftPlus_Addons_Migrator')) {
|
3149 |
|
3150 |
+
echo '<a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/tell-me-more-about-the-search-and-replace-site-location-in-the-database-option/").'">'.__('You can search and replace your database (for migrating a website to a new location/URL) with the Migrator add-on - follow this link for more information','updraftplus').'</a>';
|
3151 |
|
3152 |
}
|
3153 |
|
3158 |
</div>
|
3159 |
</fieldset>
|
3160 |
</form>
|
3161 |
+
<p><em><a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/what-should-i-understand-before-undertaking-a-restoration/");?>" target="_blank"><?php _e('Do read this helpful article of useful things to know before restoring.','updraftplus');?></a></em></p>
|
3162 |
</div>
|
3163 |
</div>
|
3164 |
|
3740 |
<th><?php _e('Incremental file backup schedule', 'updraftplus'); ?>:</th>
|
3741 |
<td>
|
3742 |
<?php do_action('updraftplus_incremental_cell', $selected_interval); ?>
|
3743 |
+
<a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/support/tell-me-more-about-incremental-backups/");?>"><em><?php _e('Tell me more about incremental backups', 'updraftplus'); ?><em></a>
|
3744 |
</td>
|
3745 |
</tr>
|
3746 |
<?php } ?>
|
3776 |
<th></th>
|
3777 |
<td><div>
|
3778 |
<?php
|
3779 |
+
echo apply_filters('updraftplus_fixtime_ftinfo', '<p>'.__('To fix the time at which a backup should take place,','updraftplus').' ('.__('e.g. if your server is busy at day and you want to run overnight','updraftplus').'), '.__('or to configure more complex schedules', 'updraftplus').', <a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/shop/updraftplus-premium/").'">'.htmlspecialchars(__('use UpdraftPlus Premium', 'updraftplus')).'</a></p>');
|
3780 |
?>
|
3781 |
</div></td>
|
3782 |
</tr>
|
3816 |
if (false === apply_filters('updraftplus_storage_printoptions', false, $active_service)) {
|
3817 |
|
3818 |
echo '</div>';
|
3819 |
+
echo '<p><a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/shop/morestorage/").'">'.htmlspecialchars(__('You can send a backup to more than one destination with an add-on.','updraftplus')).'</a></p>';
|
3820 |
echo '</td></tr>';
|
3821 |
}
|
3822 |
?>
|
3850 |
<th><?php _e('Include in files backup', 'updraftplus');?>:</th>
|
3851 |
<td>
|
3852 |
<?php echo $this->files_selector_widgetry(); ?>
|
3853 |
+
<p><?php echo apply_filters('updraftplus_admin_directories_description', __('The above directories are everything, except for WordPress core itself which you can download afresh from WordPress.org.', 'updraftplus').' <a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/shop/").'">'.htmlspecialchars(__('See also the "More Files" add-on from our shop.', 'updraftplus')).'</a>'); ?></p>
|
3854 |
</td>
|
3855 |
</tr>
|
3856 |
</table>
|
3864 |
|
3865 |
<td>
|
3866 |
<?php
|
3867 |
+
echo apply_filters('updraft_database_encryption_config', '<a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/landing/updraftplus-premium").'">'.__("Don't want to be spied on? UpdraftPlus Premium can encrypt your database backup.", 'updraftplus').'</a> '.__('It can also backup external databases.', 'updraftplus'));
|
3868 |
?>
|
3869 |
</td>
|
3870 |
</tr>
|
3946 |
?>
|
3947 |
<input type="checkbox" id="updraft_email" name="updraft_email" value="<?php esc_attr_e(get_bloginfo('admin_email')); ?>"<?php if (!empty($updraft_email)) echo ' checked="checked"';?> > <br><label for="updraft_email"><?php echo __("Check this box to have a basic report sent to", 'updraftplus').' <a href="'.admin_url('options-general.php').'">'.__("your site's admin address", 'updraftplus').'</a> ('.htmlspecialchars(get_bloginfo('admin_email')).")."; ?></label>
|
3948 |
<?php
|
3949 |
+
if (!class_exists('UpdraftPlus_Addon_Reporting')) echo '<a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/shop/reporting/").'">'.__('For more reporting features, use the Reporting add-on.', 'updraftplus').'</a>';
|
3950 |
?>
|
3951 |
</td>
|
3952 |
</tr>
|
4022 |
|
4023 |
<tr class="expertmode updraft-hidden" style="display:none;">
|
4024 |
<th><?php _e('Disable SSL entirely where possible', 'updraftplus');?>:</th>
|
4025 |
+
<td><input data-updraft_settings_test="nossl" type="checkbox" id="updraft_ssl_nossl" name="updraft_ssl_nossl" value="1" <?php if (UpdraftPlus_Options::get_updraft_option('updraft_ssl_nossl')) echo 'checked="checked"'; ?>> <br><label for="updraft_ssl_nossl"><?php _e('Choosing this option lowers your security by stopping UpdraftPlus from using SSL for authentication and encrypted transport at all, where possible. Note that some cloud storage providers do not allow this (e.g. Dropbox), so with those providers this setting will have no effect.','updraftplus');?> <a href="<?php echo apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/i-get-ssl-certificate-errors-when-backing-up-andor-restoring/");?>"><?php _e('See this FAQ also.', 'updraftplus');?></a></label></td>
|
4026 |
</tr>
|
4027 |
|
4028 |
<?php do_action('updraftplus_configprint_expertoptions'); ?>
|
4029 |
|
4030 |
<tr>
|
4031 |
+
<td></td>
|
4032 |
+
<td>
|
4033 |
+
<?php
|
4034 |
+
if (!empty($options['include_adverts'])) {
|
4035 |
+
if (!class_exists('UpdraftPlus_Notices')) require_once(UPDRAFTPLUS_DIR.'/includes/updraftplus-notices.php');
|
4036 |
+
UpdraftPlus_Notices::do_notice(false, 'bottom');
|
4037 |
+
}
|
4038 |
?>
|
|
|
|
|
|
|
|
|
4039 |
</td>
|
4040 |
</tr>
|
4041 |
<?php if (!empty($options['include_save_button'])) { ?>
|
4703 |
$credentials = request_filesystem_credentials(UpdraftPlus_Options::admin_page()."?page=updraftplus&action=updraft_restore&backup_timestamp=$timestamp", '', false, false, $extra_fields);
|
4704 |
WP_Filesystem($credentials);
|
4705 |
if ( $wp_filesystem->errors->get_error_code() ) {
|
4706 |
+
echo '<p><em><a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/asked-ftp-details-upon-restorationmigration-updates/").'">'.__('Why am I seeing this?', 'updraftplus').'</a></em></p>';
|
4707 |
foreach ( $wp_filesystem->errors->get_error_messages() as $message ) show_message($message);
|
4708 |
exit;
|
4709 |
}
|
5000 |
$pdata = (is_string($data)) ? $data : serialize($data);
|
5001 |
$updraftplus->log(__('Error data:', 'updraftplus').' '.$pdata, 'warning-restore');
|
5002 |
if (false !== strpos($pdata, 'PCLZIP_ERR_BAD_FORMAT (-10)')) {
|
5003 |
+
echo '<a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/error-message-pclzip_err_bad_format-10-invalid-archive-structure-mean/").'"><strong>'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</strong></a><br>';
|
5004 |
}
|
5005 |
}
|
5006 |
}
|
5138 |
$no_remote_configured = (empty($service) || array('none') === $service || array('') === $service) ? true : false;
|
5139 |
|
5140 |
if ($no_remote_configured) {
|
5141 |
+
return '<input type="checkbox" disabled="disabled" id="backupnow_includecloud"> <em>'.sprintf(__("Backup won't be sent to any remote storage - none has been saved in the %s", 'updraftplus'), '<a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&tab=settings" id="updraft_backupnow_gotosettings">'.__('settings', 'updraftplus')).'</a>. '.__('Not got any remote storage?', 'updraftplus').' <a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/landing/vault/").'">'.__("Check out UpdraftPlus Vault.", 'updraftplus').'</a></em>';
|
5142 |
} else {
|
5143 |
return '<input type="checkbox" id="backupnow_includecloud" checked="checked"> <label for="backupnow_includecloud">'.__("Send this backup to remote storage", 'updraftplus').'</label>';
|
5144 |
}
|
backup.php
CHANGED
@@ -919,6 +919,9 @@ class UpdraftPlus_Backup {
|
|
919 |
// Make it available to the filter
|
920 |
$jobdata['remotestorage_extrainfo'] = $this->remotestorage_extrainfo;
|
921 |
|
|
|
|
|
|
|
922 |
$body = apply_filters('updraft_report_body',
|
923 |
__('Backup of:', 'updraftplus').' '.site_url()."\r\n".
|
924 |
"UpdraftPlus ".__('WordPress backup is complete','updraftplus').".\r\n".
|
@@ -927,7 +930,7 @@ class UpdraftPlus_Backup {
|
|
927 |
$extra_msg.
|
928 |
"\r\n".
|
929 |
$feed.
|
930 |
-
$
|
931 |
$append_log,
|
932 |
$final_message, $backup_contains, $updraftplus->errors, $warnings, $jobdata);
|
933 |
|
@@ -2949,7 +2952,7 @@ class UpdraftPlus_Backup {
|
|
2949 |
|
2950 |
// Always warn of this
|
2951 |
if (strpos($msg, 'File Size Limit Exceeded') !== false && 'UpdraftPlus_BinZip' == $this->use_zip_object) {
|
2952 |
-
$updraftplus->log(sprintf(__('The zip engine returned the message: %s.', 'updraftplus'), 'File Size Limit Exceeded').'
|
2953 |
} elseif ($warn) {
|
2954 |
$warn_msg = __('A zip error occurred', 'updraftplus').' - ';
|
2955 |
if (!empty($quota_low)) {
|
919 |
// Make it available to the filter
|
920 |
$jobdata['remotestorage_extrainfo'] = $this->remotestorage_extrainfo;
|
921 |
|
922 |
+
if (!class_exists('UpdraftPlus_Notices')) require_once(UPDRAFTPLUS_DIR.'/includes/updraftplus-notices.php');
|
923 |
+
$ws_advert = UpdraftPlus_Notices::do_notice(false, 'report-plain', true);
|
924 |
+
|
925 |
$body = apply_filters('updraft_report_body',
|
926 |
__('Backup of:', 'updraftplus').' '.site_url()."\r\n".
|
927 |
"UpdraftPlus ".__('WordPress backup is complete','updraftplus').".\r\n".
|
930 |
$extra_msg.
|
931 |
"\r\n".
|
932 |
$feed.
|
933 |
+
$ws_advert."\r\n".
|
934 |
$append_log,
|
935 |
$final_message, $backup_contains, $updraftplus->errors, $warnings, $jobdata);
|
936 |
|
2952 |
|
2953 |
// Always warn of this
|
2954 |
if (strpos($msg, 'File Size Limit Exceeded') !== false && 'UpdraftPlus_BinZip' == $this->use_zip_object) {
|
2955 |
+
$updraftplus->log(sprintf(__('The zip engine returned the message: %s.', 'updraftplus'), 'File Size Limit Exceeded'). __('Go here for more information.','updraftplus').' https://updraftplus.com/what-should-i-do-if-i-see-the-message-file-size-limit-exceeded/', 'warning', 'zipcloseerror-filesizelimit');
|
2956 |
} elseif ($warn) {
|
2957 |
$warn_msg = __('A zip error occurred', 'updraftplus').' - ';
|
2958 |
if (!empty($quota_low)) {
|
class-updraftplus.php
CHANGED
@@ -2335,7 +2335,7 @@ class UpdraftPlus {
|
|
2335 |
# TODO: Make compatible with incremental naming
|
2336 |
if ($remotescan) {
|
2337 |
add_action('http_request_args', array($this, 'modify_http_options'));
|
2338 |
-
foreach ($this->backup_methods as $method => $
|
2339 |
require_once(UPDRAFTPLUS_DIR.'/methods/'.$method.'.php');
|
2340 |
$objname = 'UpdraftPlus_BackupModule_'.$method;
|
2341 |
$obj = new $objname;
|
@@ -2359,9 +2359,10 @@ class UpdraftPlus {
|
|
2359 |
if ('no_settings' == $code || 'no_addon' == $code || 'insufficient_php' == $code || 'no_listing' == $code) continue;
|
2360 |
$messages[] = array(
|
2361 |
'method' => $method,
|
2362 |
-
'desc' => $
|
2363 |
'code' => $code,
|
2364 |
-
'message' => $files->get_error_message($code)
|
|
|
2365 |
);
|
2366 |
}
|
2367 |
}
|
@@ -3650,18 +3651,26 @@ class UpdraftPlus {
|
|
3650 |
return ($memory_limit >= $memory)?true:false;
|
3651 |
}
|
3652 |
|
3653 |
-
private function url_start($
|
3654 |
$proto = ($https) ? 'https' : 'http';
|
3655 |
if (strpos($url, 'updraftplus.com') !== false){
|
3656 |
-
return
|
3657 |
}else{
|
3658 |
-
return
|
3659 |
}
|
3660 |
}
|
3661 |
|
3662 |
-
private function url_end($
|
3663 |
$proto = ($https) ? 'https' : 'http';
|
3664 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3665 |
}
|
3666 |
|
3667 |
public function get_updraftplus_rssfeed() {
|
@@ -3669,52 +3678,6 @@ class UpdraftPlus {
|
|
3669 |
return fetch_feed('http://feeds.feedburner.com/updraftplus/');
|
3670 |
}
|
3671 |
|
3672 |
-
public function wordshell_random_advert($urls) {
|
3673 |
-
if (defined('UPDRAFTPLUS_NOADS_B')) return "";
|
3674 |
-
$rad = rand(0, 8);
|
3675 |
-
switch ($rad) {
|
3676 |
-
case 0:
|
3677 |
-
return $this->url_start($urls,'updraftplus.com/').__("Want more features or paid, guaranteed support? Check out UpdraftPlus.Com", 'updraftplus').$this->url_end($urls,'updraftplus.com');
|
3678 |
-
break;
|
3679 |
-
case 1:
|
3680 |
-
$wplang = get_locale();
|
3681 |
-
if (strlen($wplang)>0 && !is_file(UPDRAFTPLUS_DIR.'/languages/updraftplus-'.$wplang.
|
3682 |
-
'.mo')) return __('Can you translate? Want to improve UpdraftPlus for speakers of your language?','updraftplus').' '.$this->url_start($urls,'updraftplus.com/translate/')."Please go here for instructions - it is easy.".$this->url_end($urls,'updraftplus.com/translate/');
|
3683 |
-
|
3684 |
-
return __('UpdraftPlus is on social media - check us out here:','updraftplus').' '.$this->url_start($urls,'twitter.com/updraftplus', true).__('Twitter', 'updraftplus').$this->url_end($urls,'twitter.com/updraftplus', true).' - '.$this->url_start($urls,'facebook.com/updraftplus', true).__('Facebook', 'updraftplus').$this->url_end($urls,'facebook.com/updraftplus', true).' - '.$this->url_start($urls,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).__('Google+', 'updraftplus').$this->url_end($urls,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).' - '.$this->url_start($urls,'www.linkedin.com/company/updraftplus', true).__('LinkedIn', 'updraftplus').$this->url_end($urls,'www.linkedin.com/company/updraftplus', true);
|
3685 |
-
break;
|
3686 |
-
case 2:
|
3687 |
-
return $this->url_start($urls,'wordshell.net').__("Check out WordShell", 'updraftplus').$this->url_end($urls,'www.wordshell.net')." - ".__('manage WordPress from the command line - huge time-saver', 'updraftplus');
|
3688 |
-
break;
|
3689 |
-
case 3:
|
3690 |
-
return __('Like UpdraftPlus and can spare one minute?','updraftplus').$this->url_start($urls,'wordpress.org/support/view/plugin-reviews/updraftplus#postform').' '.__('Please help UpdraftPlus by giving a positive review at wordpress.org','updraftplus').$this->url_end($urls,'wordpress.org/support/view/plugin-reviews/updraftplus#postform');
|
3691 |
-
break;
|
3692 |
-
case 4:
|
3693 |
-
return $this->url_start($urls,'updraftplus.com/newsletter-signup', true).__("Follow this link to sign up for the UpdraftPlus newsletter.", 'updraftplus').$this->url_end($urls,'updraftplus.com/newsletter-signup', true);
|
3694 |
-
break;
|
3695 |
-
case 5:
|
3696 |
-
if (!defined('UPDRAFTPLUS_NOADS_B')) {
|
3697 |
-
return $this->url_start($urls,'updraftplus.com/').__("Need even more features and support? Check out UpdraftPlus Premium",'updraftplus').$this->url_end($urls,'updraftplus.com');
|
3698 |
-
} else {
|
3699 |
-
return "Thanks for being an UpdraftPlus premium user. Keep visiting ".$this->url_start($urls,'updraftplus.com/')."updraftplus.com".$this->url_end($urls,'updraftplus.com')." to see what's going on.";
|
3700 |
-
}
|
3701 |
-
break;
|
3702 |
-
case 6:
|
3703 |
-
// return "Need custom WordPress services from experts (including bespoke development)?".$this->url_start($urls,'www.simbahosting.co.uk/s3/products-and-services/wordpress-experts/')." Get them from the creators of UpdraftPlus.".$this->url_end($urls,'www.simbahosting.co.uk/s3/products-and-services/wordpress-experts/');
|
3704 |
-
return __("Subscribe to the UpdraftPlus blog to get up-to-date news and offers",'updraftplus')." - ".$this->url_start($urls,'updraftplus.com/news/').__("Blog link",'updraftplus').$this->url_end($urls,'updraftplus.com/news/').' - '.$this->url_start($urls,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').$this->url_end($urls,'feeds.feedburner.com/UpdraftPlus');
|
3705 |
-
break;
|
3706 |
-
case 7:
|
3707 |
-
return $this->url_start($urls,'updraftplus.com/').__("Check out UpdraftPlus.Com for help, add-ons and support",'updraftplus').$this->url_end($urls,'updraftplus.com');
|
3708 |
-
break;
|
3709 |
-
// case 8:
|
3710 |
-
// return __("Want to say thank-you for UpdraftPlus?",'updraftplus').$this->url_start($urls,'updraftplus.com/shop/', true)." ".__("Please buy our very cheap 'no adverts' add-on.",'updraftplus').$this->url_end($urls,'updraftplus.com/shop/', true);
|
3711 |
-
// break;
|
3712 |
-
case 8:
|
3713 |
-
return __('UpdraftPlus is on social media - check us out here:','updraftplus').' '.$this->url_start($urls,'twitter.com/updraftplus', true).__('Twitter', 'updraftplus').$this->url_end($urls,'twitter.com/updraftplus', true).' - '.$this->url_start($urls,'facebook.com/updraftplus', true).__('Facebook', 'updraftplus').$this->url_end($urls,'facebook.com/updraftplus', true).' - '.$this->url_start($urls,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).__('Google+', 'updraftplus').$this->url_end($urls,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).' - '.$this->url_start($urls,'www.linkedin.com/company/updraftplus', true).__('LinkedIn', 'updraftplus').$this->url_end($urls,'www.linkedin.com/company/updraftplus', true);
|
3714 |
-
break;
|
3715 |
-
}
|
3716 |
-
}
|
3717 |
-
|
3718 |
public function analyse_db_file($timestamp, $res, $db_file = false, $header_only = false) {
|
3719 |
|
3720 |
$mess = array(); $warn = array(); $err = array(); $info = array();
|
@@ -4038,7 +4001,7 @@ CREATE TABLE $wpdb->signups (
|
|
4038 |
// These are used in 4 places (Feb 2016 - of course, you should re-scan the code to check if relying on this): showing current settings on the debug modal, wiping all current settings, getting a settings bundle to restore when migrating, and for relevant keys in POST-ed data when saving settings over AJAX
|
4039 |
public function get_settings_keys() {
|
4040 |
// N.B. updraft_backup_history is not included here, as we don't want that wiped
|
4041 |
-
return array('updraft_autobackup_default', 'updraft_dropbox', 'updraft_googledrive', 'updraftplus_tmp_googledrive_access_token', 'updraftplus_dismissedautobackup', 'updraftplus_dismissedexpiry', 'updraftplus_dismisseddashnotice', 'updraft_interval', 'updraft_interval_increments', 'updraft_interval_database', 'updraft_retain', 'updraft_retain_db', 'updraft_encryptionphrase', 'updraft_service', 'updraft_dropbox_appkey', 'updraft_dropbox_secret', 'updraft_googledrive_clientid', 'updraft_googledrive_secret', 'updraft_googledrive_remotepath', 'updraft_ftp', 'updraft_ftp_login', 'updraft_ftp_pass', 'updraft_ftp_remote_path', 'updraft_server_address', 'updraft_dir', 'updraft_email', 'updraft_delete_local', 'updraft_debug_mode', 'updraft_include_plugins', 'updraft_include_themes', 'updraft_include_uploads', 'updraft_include_others', 'updraft_include_wpcore', 'updraft_include_wpcore_exclude', 'updraft_include_more', 'updraft_include_blogs', 'updraft_include_mu-plugins',
|
4042 |
'updraft_include_others_exclude', 'updraft_include_uploads_exclude', 'updraft_lastmessage', 'updraft_googledrive_token', 'updraft_dropboxtk_request_token', 'updraft_dropboxtk_access_token', 'updraft_dropbox_folder', 'updraft_adminlocking', 'updraft_updraftvault', 'updraft_remotesites', 'updraft_migrator_localkeys', 'updraft_central_localkeys', 'updraft_retain_extrarules', 'updraft_googlecloud', 'updraft_include_more_path', 'updraft_split_every', 'updraft_ssl_nossl', 'updraft_backupdb_nonwp', 'updraft_extradbs', 'updraft_combine_jobs_around',
|
4043 |
'updraft_last_backup', 'updraft_starttime_files', 'updraft_starttime_db', 'updraft_startday_db', 'updraft_startday_files', 'updraft_sftp_settings', 'updraft_s3', 'updraft_s3generic', 'updraft_dreamhost', 'updraft_s3generic_login', 'updraft_s3generic_pass', 'updraft_s3generic_remote_path', 'updraft_s3generic_endpoint', 'updraft_webdav_settings', 'updraft_openstack', 'updraft_bitcasa', 'updraft_copycom', 'updraft_onedrive', 'updraft_azure', 'updraft_cloudfiles', 'updraft_cloudfiles_user', 'updraft_cloudfiles_apikey', 'updraft_cloudfiles_path', 'updraft_cloudfiles_authurl', 'updraft_ssl_useservercerts', 'updraft_ssl_disableverify', 'updraft_s3_login', 'updraft_s3_pass', 'updraft_s3_remote_path', 'updraft_dreamobjects_login', 'updraft_dreamobjects_pass', 'updraft_dreamobjects_remote_path', 'updraft_dreamobjects', 'updraft_report_warningsonly', 'updraft_report_wholebackup', 'updraft_log_syslog', 'updraft_extradatabases');
|
4044 |
}
|
2335 |
# TODO: Make compatible with incremental naming
|
2336 |
if ($remotescan) {
|
2337 |
add_action('http_request_args', array($this, 'modify_http_options'));
|
2338 |
+
foreach ($this->backup_methods as $method => $method_description) {
|
2339 |
require_once(UPDRAFTPLUS_DIR.'/methods/'.$method.'.php');
|
2340 |
$objname = 'UpdraftPlus_BackupModule_'.$method;
|
2341 |
$obj = new $objname;
|
2359 |
if ('no_settings' == $code || 'no_addon' == $code || 'insufficient_php' == $code || 'no_listing' == $code) continue;
|
2360 |
$messages[] = array(
|
2361 |
'method' => $method,
|
2362 |
+
'desc' => $method_description,
|
2363 |
'code' => $code,
|
2364 |
+
'message' => $files->get_error_message($code),
|
2365 |
+
'data' => $files->get_error_data($code),
|
2366 |
);
|
2367 |
}
|
2368 |
}
|
3651 |
return ($memory_limit >= $memory)?true:false;
|
3652 |
}
|
3653 |
|
3654 |
+
private function url_start($html_allowed, $url, $https = false) {
|
3655 |
$proto = ($https) ? 'https' : 'http';
|
3656 |
if (strpos($url, 'updraftplus.com') !== false){
|
3657 |
+
return $html_allowed ? "<a href=".apply_filters('updraftplus_com_link',$proto.'://'.$url).">" : "";
|
3658 |
}else{
|
3659 |
+
return $html_allowed ? "<a href=\"$proto://$url\">" : "";
|
3660 |
}
|
3661 |
}
|
3662 |
|
3663 |
+
private function url_end($html_allowed, $url, $https = false) {
|
3664 |
$proto = ($https) ? 'https' : 'http';
|
3665 |
+
return $html_allowed ? '</a>' : " ($proto://$url)";
|
3666 |
+
}
|
3667 |
+
|
3668 |
+
private function translation_needed() {
|
3669 |
+
$wplang = get_locale();
|
3670 |
+
if (strlen($wplang) < 1 || $wplang == 'en_US' || $wplang == 'en_GB') return false;
|
3671 |
+
if (defined('WP_LANG_DIR') && is_file(WP_LANG_DIR.'/plugins/updraftplus-'.$wplang.'.mo')) return false;
|
3672 |
+
if (is_file(UPDRAFTPLUS_DIR.'/languages/updraftplus-'.$wplang.'.mo')) return false;
|
3673 |
+
return true;
|
3674 |
}
|
3675 |
|
3676 |
public function get_updraftplus_rssfeed() {
|
3678 |
return fetch_feed('http://feeds.feedburner.com/updraftplus/');
|
3679 |
}
|
3680 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3681 |
public function analyse_db_file($timestamp, $res, $db_file = false, $header_only = false) {
|
3682 |
|
3683 |
$mess = array(); $warn = array(); $err = array(); $info = array();
|
4001 |
// These are used in 4 places (Feb 2016 - of course, you should re-scan the code to check if relying on this): showing current settings on the debug modal, wiping all current settings, getting a settings bundle to restore when migrating, and for relevant keys in POST-ed data when saving settings over AJAX
|
4002 |
public function get_settings_keys() {
|
4003 |
// N.B. updraft_backup_history is not included here, as we don't want that wiped
|
4004 |
+
return array('updraft_autobackup_default', 'updraft_dropbox', 'updraft_googledrive', 'updraftplus_tmp_googledrive_access_token', 'updraftplus_dismissedautobackup', 'dismissed_general_notices_until', 'dismissed_season_notices_until', 'updraftplus_dismissedexpiry', 'updraftplus_dismisseddashnotice', 'updraft_interval', 'updraft_interval_increments', 'updraft_interval_database', 'updraft_retain', 'updraft_retain_db', 'updraft_encryptionphrase', 'updraft_service', 'updraft_dropbox_appkey', 'updraft_dropbox_secret', 'updraft_googledrive_clientid', 'updraft_googledrive_secret', 'updraft_googledrive_remotepath', 'updraft_ftp', 'updraft_ftp_login', 'updraft_ftp_pass', 'updraft_ftp_remote_path', 'updraft_server_address', 'updraft_dir', 'updraft_email', 'updraft_delete_local', 'updraft_debug_mode', 'updraft_include_plugins', 'updraft_include_themes', 'updraft_include_uploads', 'updraft_include_others', 'updraft_include_wpcore', 'updraft_include_wpcore_exclude', 'updraft_include_more', 'updraft_include_blogs', 'updraft_include_mu-plugins',
|
4005 |
'updraft_include_others_exclude', 'updraft_include_uploads_exclude', 'updraft_lastmessage', 'updraft_googledrive_token', 'updraft_dropboxtk_request_token', 'updraft_dropboxtk_access_token', 'updraft_dropbox_folder', 'updraft_adminlocking', 'updraft_updraftvault', 'updraft_remotesites', 'updraft_migrator_localkeys', 'updraft_central_localkeys', 'updraft_retain_extrarules', 'updraft_googlecloud', 'updraft_include_more_path', 'updraft_split_every', 'updraft_ssl_nossl', 'updraft_backupdb_nonwp', 'updraft_extradbs', 'updraft_combine_jobs_around',
|
4006 |
'updraft_last_backup', 'updraft_starttime_files', 'updraft_starttime_db', 'updraft_startday_db', 'updraft_startday_files', 'updraft_sftp_settings', 'updraft_s3', 'updraft_s3generic', 'updraft_dreamhost', 'updraft_s3generic_login', 'updraft_s3generic_pass', 'updraft_s3generic_remote_path', 'updraft_s3generic_endpoint', 'updraft_webdav_settings', 'updraft_openstack', 'updraft_bitcasa', 'updraft_copycom', 'updraft_onedrive', 'updraft_azure', 'updraft_cloudfiles', 'updraft_cloudfiles_user', 'updraft_cloudfiles_apikey', 'updraft_cloudfiles_path', 'updraft_cloudfiles_authurl', 'updraft_ssl_useservercerts', 'updraft_ssl_disableverify', 'updraft_s3_login', 'updraft_s3_pass', 'updraft_s3_remote_path', 'updraft_dreamobjects_login', 'updraft_dreamobjects_pass', 'updraft_dreamobjects_remote_path', 'updraft_dreamobjects', 'updraft_report_warningsonly', 'updraft_report_wholebackup', 'updraft_log_syslog', 'updraft_extradatabases');
|
4007 |
}
|
css/admin.css
CHANGED
@@ -235,14 +235,6 @@ h3 .thank-you {
|
|
235 |
clear:left;
|
236 |
}
|
237 |
|
238 |
-
a .udp-logo {
|
239 |
-
border: 0px;
|
240 |
-
float: right;
|
241 |
-
height: 150px;
|
242 |
-
width: 150px;
|
243 |
-
margin: 20px 15px 15px 35px;
|
244 |
-
}
|
245 |
-
|
246 |
.dismiss-dash-notice {
|
247 |
float: right;
|
248 |
position: relative;
|
@@ -504,13 +496,6 @@ a .udp-logo {
|
|
504 |
font-size: 120%
|
505 |
}
|
506 |
|
507 |
-
.word-shell-advert {
|
508 |
-
max-width: 800px;
|
509 |
-
font-size: 140%;
|
510 |
-
line-height: 140%;
|
511 |
-
padding: 14px;
|
512 |
-
}
|
513 |
-
|
514 |
.memory-limit {
|
515 |
padding:8px;
|
516 |
}
|
@@ -838,16 +823,6 @@ input #backupnow_includefiles_moreoptions {
|
|
838 |
font-weight: bold;
|
839 |
}
|
840 |
|
841 |
-
.wordshell-advert {
|
842 |
-
margin: 10px 0;
|
843 |
-
padding: 10px;
|
844 |
-
font-size: 140%;
|
845 |
-
background-color: lightYellow;
|
846 |
-
border-color: #E6DB55;
|
847 |
-
border: 1px solid;
|
848 |
-
border-radius: 4px;
|
849 |
-
}
|
850 |
-
|
851 |
.double-warning {
|
852 |
border:1px solid;
|
853 |
padding: 6px;
|
@@ -1549,4 +1524,4 @@ a.btn-get-started {
|
|
1549 |
.expertmode .advanced_settings_container .advanced_settings_menu .advanced_tools_button {
|
1550 |
display: block;
|
1551 |
}
|
1552 |
-
}
|
235 |
clear:left;
|
236 |
}
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
.dismiss-dash-notice {
|
239 |
float: right;
|
240 |
position: relative;
|
496 |
font-size: 120%
|
497 |
}
|
498 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
.memory-limit {
|
500 |
padding:8px;
|
501 |
}
|
823 |
font-weight: bold;
|
824 |
}
|
825 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
826 |
.double-warning {
|
827 |
border:1px solid;
|
828 |
padding: 6px;
|
1524 |
.expertmode .advanced_settings_container .advanced_settings_menu .advanced_tools_button {
|
1525 |
display: block;
|
1526 |
}
|
1527 |
+
}
|
css/updraftplus-notices.css
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS for adverts */
|
2 |
+
|
3 |
+
.updraft_notice_container {
|
4 |
+
height: auto;
|
5 |
+
overflow: hidden;
|
6 |
+
}
|
7 |
+
|
8 |
+
.updraft_advert_content_left {
|
9 |
+
float:none;
|
10 |
+
width:65px;
|
11 |
+
}
|
12 |
+
|
13 |
+
.updraft_advert_content_right {
|
14 |
+
float:none;
|
15 |
+
width:auto;
|
16 |
+
overflow: hidden;
|
17 |
+
}
|
18 |
+
|
19 |
+
.updraft_advert_bottom {
|
20 |
+
margin: 10px 0;
|
21 |
+
padding: 10px;
|
22 |
+
font-size: 140%;
|
23 |
+
background-color: white;
|
24 |
+
border-color: #E6DB55;
|
25 |
+
border: 1px solid;
|
26 |
+
border-radius: 4px;
|
27 |
+
}
|
28 |
+
|
29 |
+
.updraft-advert-dismiss {
|
30 |
+
float: right;
|
31 |
+
font-size: 13px;
|
32 |
+
font-weight: normal;
|
33 |
+
}
|
34 |
+
|
35 |
+
h3.updraft_advert_heading {
|
36 |
+
margin-top: 5px !important;
|
37 |
+
margin-bottom: 5px !important;
|
38 |
+
}
|
39 |
+
|
40 |
+
h4.updraft_advert_heading {
|
41 |
+
margin-top: 2px !important;
|
42 |
+
margin-bottom: 3px !important;
|
43 |
+
}
|
44 |
+
|
45 |
+
.updraft_center_content {
|
46 |
+
text-align: center;
|
47 |
+
margin-bottom:5px;
|
48 |
+
}
|
49 |
+
|
50 |
+
.updraft_notice_link {
|
51 |
+
padding-left:5px;
|
52 |
+
}
|
53 |
+
|
54 |
+
.updraft_text_center {
|
55 |
+
text-align: center;
|
56 |
+
}
|
57 |
+
|
58 |
+
@media screen and (min-width: 560px) {
|
59 |
+
.updraft_advert_content_left {
|
60 |
+
float: left;
|
61 |
+
}
|
62 |
+
}
|
images/notices/black_friday.png
ADDED
Binary file
|
images/notices/christmas.png
ADDED
Binary file
|
images/notices/locksettings.png
ADDED
Binary file
|
images/notices/migrator.png
ADDED
Binary file
|
images/notices/multiplestorage_destinations.png
ADDED
Binary file
|
images/notices/new_year.png
ADDED
Binary file
|
images/notices/reporting.png
ADDED
Binary file
|
images/notices/spring.png
ADDED
Binary file
|
images/notices/summer.png
ADDED
Binary file
|
images/notices/support.png
ADDED
Binary file
|
images/notices/updraft_logo.png
ADDED
Binary file
|
includes/Dropbox2/API.php
CHANGED
@@ -368,8 +368,11 @@ class UpdraftPlus_Dropbox_API {
|
|
368 |
*/
|
369 |
public function search($query, $path = '', $limit = 1000) {
|
370 |
$call = '2/files/search';
|
|
|
|
|
|
|
371 |
$params = array(
|
372 |
-
'path' => $
|
373 |
'query' => $query,
|
374 |
'max_results' => ($limit < 1) ? 1 : (($limit > 1000) ? 1000 : (int) $limit),
|
375 |
'api_v2' => true,
|
368 |
*/
|
369 |
public function search($query, $path = '', $limit = 1000) {
|
370 |
$call = '2/files/search';
|
371 |
+
$path = $this->encodePath($path);
|
372 |
+
// APIv2 requires that the path match this regex: String(pattern="(/(.|[\r\n])*)?|(ns:[0-9]+(/.*)?)")
|
373 |
+
if ($path && '/' != substr($path, 0, 1)) $path = "/$path";
|
374 |
$params = array(
|
375 |
+
'path' => $path,
|
376 |
'query' => $query,
|
377 |
'max_results' => ($limit < 1) ? 1 : (($limit > 1000) ? 1000 : (int) $limit),
|
378 |
'api_v2' => true,
|
includes/labelauty/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2013 Francisco Neves
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6 |
+
this software and associated documentation files (the "Software"), to deal in
|
7 |
+
the Software without restriction, including without limitation the rights to
|
8 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10 |
+
subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
includes/updraft-admin-ui.js
CHANGED
@@ -647,6 +647,9 @@ function updraft_updatehistory(rescan, remotescan) {
|
|
647 |
updraft_history_lastchecksum = resp.cksum;
|
648 |
}
|
649 |
jQuery('#updraft-navtab-backups-content .updraft_existing_backups').html(resp.t);
|
|
|
|
|
|
|
650 |
}
|
651 |
} catch(err) {
|
652 |
console.log(updraftlion.unexpectedresponse+' '+response);
|
647 |
updraft_history_lastchecksum = resp.cksum;
|
648 |
}
|
649 |
jQuery('#updraft-navtab-backups-content .updraft_existing_backups').html(resp.t);
|
650 |
+
if (resp.data) {
|
651 |
+
console.log(resp.data);
|
652 |
+
}
|
653 |
}
|
654 |
} catch(err) {
|
655 |
console.log(updraftlion.unexpectedresponse+' '+response);
|
includes/updraftplus-notices.php
ADDED
@@ -0,0 +1,384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed');
|
4 |
+
|
5 |
+
class UpdraftPlus_Notices {
|
6 |
+
|
7 |
+
private static $initialized = false;
|
8 |
+
|
9 |
+
private static $notices_content = array();
|
10 |
+
|
11 |
+
private static function populate_notices_content() {
|
12 |
+
|
13 |
+
// These variables are just short-hands to be used below.
|
14 |
+
$dashboard_top = array('top');
|
15 |
+
$dashboard_top_or_report = array('top', 'report');
|
16 |
+
$dashboard_bottom_or_report = array('bottom', 'report', 'report-plain');
|
17 |
+
$anywhere = array('top', 'bottom', 'report', 'report-plain');
|
18 |
+
$autobackup = array('autobackup');
|
19 |
+
$autobackup_bottom_or_report = array('autobackup', 'bottom', 'report', 'report-plain');
|
20 |
+
|
21 |
+
return array(
|
22 |
+
1 => array(
|
23 |
+
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
|
24 |
+
'title' => __('support', 'updraftplus'),
|
25 |
+
'text' => __('Enjoy professional, fast, and friendly help whenever you need it.', 'updraftplus'),
|
26 |
+
'image' => 'notices/support.png',
|
27 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
28 |
+
'button_meta' => 'updraftplus',
|
29 |
+
'dismiss_time' => 'dismiss_notice',
|
30 |
+
'supported_positions' => $dashboard_top_or_report,
|
31 |
+
),
|
32 |
+
2 => array(
|
33 |
+
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
|
34 |
+
'title' => __('UpdraftVault storage', 'updraftplus'),
|
35 |
+
'text' => __('The ultimately secure and convenient place to store your backups.', 'updraftplus'),
|
36 |
+
'image' => 'notices/updraft_logo.png',
|
37 |
+
'button_link' => 'https://updraftplus.com/landing/vault',
|
38 |
+
'button_meta' => 'updraftplus',
|
39 |
+
'dismiss_time' => 'dismiss_notice',
|
40 |
+
'supported_positions' => $dashboard_top_or_report,
|
41 |
+
),
|
42 |
+
3 => array(
|
43 |
+
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
|
44 |
+
'title' => __('enhanced remote storage options', 'updraftplus'),
|
45 |
+
'text' => __('Enhanced storage options for Dropbox, Google Drive and S3. Plus many more options.', 'updraftplus'),
|
46 |
+
'image' => 'notices/multiplestorage_destinations.png',
|
47 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
48 |
+
'button_meta' => 'updraftplus',
|
49 |
+
'dismiss_time' => 'dismiss_notice',
|
50 |
+
'supported_positions' => $dashboard_top_or_report,
|
51 |
+
),
|
52 |
+
4 => array(
|
53 |
+
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
|
54 |
+
'title' => __('advanced options', 'updraftplus'),
|
55 |
+
'text' => __('Secure multisite installation, advanced reporting and much more.', 'updraftplus'),
|
56 |
+
'image' => 'notices/reporting.png',
|
57 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
58 |
+
'button_meta' => 'updraftplus',
|
59 |
+
'dismiss_time' => 'dismiss_notice',
|
60 |
+
'supported_positions' => $dashboard_top_or_report,
|
61 |
+
),
|
62 |
+
5 => array(
|
63 |
+
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
|
64 |
+
'title' => __('secure your backups', 'updraftplus'),
|
65 |
+
'text' => __('Add SFTP to send your data securely, lock settings and encrypt your database backups for extra security.', 'updraftplus'),
|
66 |
+
'image' => 'notices/locksettings.png',
|
67 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
68 |
+
'button_meta' => 'updraftplus',
|
69 |
+
'dismiss_time' => 'dismiss_notice',
|
70 |
+
'supported_positions' => $dashboard_top_or_report,
|
71 |
+
),
|
72 |
+
6 => array(
|
73 |
+
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
|
74 |
+
'title' => __('easily migrate or clone your site in minutes', 'updraftplus'),
|
75 |
+
'text' => __('Copy your site to another domain directly. Includes find-and-replace tool for database references.', 'updraftplus'),
|
76 |
+
'image' => 'notices/migrator.png',
|
77 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
78 |
+
'button_meta' => 'updraftplus',
|
79 |
+
'dismiss_time' => 'dismiss_notice',
|
80 |
+
'supported_positions' => $anywhere,
|
81 |
+
),
|
82 |
+
7 => array(
|
83 |
+
'prefix' => '',
|
84 |
+
'title' => __('Introducing UpdraftCentral', 'updraftplus'),
|
85 |
+
'text' => __('UpdraftCentral is a highly efficient way to manage, update and backup multiple websites from one place.', 'updraftplus'),
|
86 |
+
'image' => 'notices/updraft_logo.png',
|
87 |
+
'button_link' => 'https://updraftcentral.com',
|
88 |
+
'button_meta' => 'updraftcentral',
|
89 |
+
'dismiss_time' => 'dismiss_notice',
|
90 |
+
'supported_positions' => $dashboard_top_or_report,
|
91 |
+
),
|
92 |
+
8 => array(
|
93 |
+
'prefix' => '',
|
94 |
+
'title' => __('Like UpdraftPlus and can spare one minute?', 'updraftplus'),
|
95 |
+
'text' => __('Please help UpdraftPlus by giving a positive review at wordpress.org.', 'updraftplus'),
|
96 |
+
'image' => 'notices/updraft_logo.png',
|
97 |
+
'button_link' => 'https://wordpress.org/support/plugin/updraftplus/reviews/?rate=5#new-post',
|
98 |
+
'button_meta' => 'review',
|
99 |
+
'dismiss_time' => 'dismiss_notice',
|
100 |
+
'supported_positions' => $anywhere,
|
101 |
+
),
|
102 |
+
9 => array(
|
103 |
+
'prefix' => '',
|
104 |
+
'title' => __('Do you use UpdraftPlus on multiple sites?', 'updraftplus'),
|
105 |
+
'text' => __('Control all your WordPress installations from one place using UpdraftCentral remote site management!', 'updraftplus'),
|
106 |
+
'image' => 'notices/updraft_logo.png',
|
107 |
+
'button_link' => 'https://updraftcentral.com',
|
108 |
+
'button_meta' => 'updraftcentral',
|
109 |
+
'dismiss_time' => 'dismiss_notice',
|
110 |
+
'supported_positions' => $anywhere,
|
111 |
+
),
|
112 |
+
'translation_needed' => array(
|
113 |
+
'prefix' => '',
|
114 |
+
'title' => 'Can you translate? Want to improve UpdraftPlus for speakers of your language?',
|
115 |
+
'text' => self::url_start(true,'updraftplus.com/translate/')."Please go here for instructions - it is easy.".self::url_end(true,'updraftplus.com/translate/'),
|
116 |
+
'text_plain' => self::url_start(false,'updraftplus.com/translate/')."Please go here for instructions - it is easy.".self::url_end(false,'updraftplus.com/translate/'),
|
117 |
+
'image' => 'notices/updraft_logo.png',
|
118 |
+
'button_link' => false,
|
119 |
+
'dismiss_time' => false,
|
120 |
+
'supported_positions' => $anywhere,
|
121 |
+
'validity_function' => 'translation_needed',
|
122 |
+
),
|
123 |
+
'social_media' => array(
|
124 |
+
'prefix' => '',
|
125 |
+
'title' => __('UpdraftPlus is on social media - check us out!', 'updraftplus'),
|
126 |
+
'text' => self::url_start(true,'twitter.com/updraftplus', true).__('Twitter', 'updraftplus').self::url_end(true,'twitter.com/updraftplus', true).' - '.self::url_start(true,'facebook.com/updraftplus', true).__('Facebook', 'updraftplus').self::url_end(true,'facebook.com/updraftplus', true).' - '.self::url_start(true,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).__('Google+', 'updraftplus').self::url_end(true,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).' - '.self::url_start(true,'www.linkedin.com/company/updraftplus', true).__('LinkedIn', 'updraftplus').self::url_end(true,'www.linkedin.com/company/updraftplus', true),
|
127 |
+
'text_plain' => self::url_start(false,'twitter.com/updraftplus', true).__('Twitter', 'updraftplus').self::url_end(false,'twitter.com/updraftplus', true).' - '.self::url_start(false,'facebook.com/updraftplus', true).__('Facebook', 'updraftplus').self::url_end(false,'facebook.com/updraftplus', true).' - '.self::url_start(false,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).__('Google+', 'updraftplus').self::url_end(false,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).' - '.self::url_start(false,'www.linkedin.com/company/updraftplus', true).__('LinkedIn', 'updraftplus').self::url_end(false,'www.linkedin.com/company/updraftplus', true),
|
128 |
+
'image' => 'notices/updraft_logo.png',
|
129 |
+
'dismiss_time' => false,
|
130 |
+
'supported_positions' => $anywhere,
|
131 |
+
),
|
132 |
+
'newsletter' => array(
|
133 |
+
'prefix' => '',
|
134 |
+
'title' => __('UpdraftPlus Newsletter', 'updraftplus'),
|
135 |
+
'text' => __("Follow this link to sign up for the UpdraftPlus newsletter.", 'updraftplus'),
|
136 |
+
'image' => 'notices/updraft_logo.png',
|
137 |
+
'button_link' => 'https://updraftplus.com/newsletter-signup',
|
138 |
+
'button_meta' => 'signup',
|
139 |
+
'supported_positions' => $anywhere,
|
140 |
+
'dismiss_time' => false
|
141 |
+
),
|
142 |
+
'subscribe_blog' => array(
|
143 |
+
'prefix' => '',
|
144 |
+
'title' => __('UpdraftPlus Blog - get up-to-date news and offers', 'updraftplus'),
|
145 |
+
'text' => self::url_start(true,'updraftplus.com/news/').__("Blog link",'updraftplus').self::url_end(true,'updraftplus.com/news/').' - '.self::url_start(true,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').self::url_end(true,'feeds.feedburner.com/UpdraftPlus'),
|
146 |
+
'text_plain' => self::url_start(false,'updraftplus.com/news/').__("Blog link",'updraftplus').self::url_end(false,'updraftplus.com/news/').' - '.self::url_start(false,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').self::url_end(false,'feeds.feedburner.com/UpdraftPlus'),
|
147 |
+
'image' => 'notices/updraft_logo.png',
|
148 |
+
'button_link' => false,
|
149 |
+
'supported_positions' => $anywhere,
|
150 |
+
'dismiss_time' => false
|
151 |
+
),
|
152 |
+
'check_out_updraftplus_com' => array(
|
153 |
+
'prefix' => '',
|
154 |
+
'title' => __('UpdraftPlus Blog - get up-to-date news and offers', 'updraftplus'),
|
155 |
+
'text' => self::url_start(true,'updraftplus.com/news/').__("Blog link",'updraftplus').self::url_end(true,'updraftplus.com/news/').' - '.self::url_start(true,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').self::url_end(true,'feeds.feedburner.com/UpdraftPlus'),
|
156 |
+
'text_plain' => self::url_start(false,'updraftplus.com/news/').__("Blog link",'updraftplus').self::url_end(false,'updraftplus.com/news/').' - '.self::url_start(false,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').self::url_end(false,'feeds.feedburner.com/UpdraftPlus'),
|
157 |
+
'image' => 'notices/updraft_logo.png',
|
158 |
+
'button_link' => false,
|
159 |
+
'supported_positions' => $dashboard_bottom_or_report,
|
160 |
+
'dismiss_time' => false
|
161 |
+
),
|
162 |
+
'autobackup' => array(
|
163 |
+
'prefix' => '',
|
164 |
+
'title' => __('Be safe with an automatic backup', 'updraftplus'),
|
165 |
+
'text' => __('UpdraftPlus Premium can automatically backup your plugins/themes/database before you update, without you needing to remember.', 'updraftplus'),
|
166 |
+
'image' => 'automaticbackup.png',
|
167 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
168 |
+
'button_meta' => 'updraftplus',
|
169 |
+
'dismiss_time' => 'dismissautobackup',
|
170 |
+
'supported_positions' => $autobackup_bottom_or_report,
|
171 |
+
),
|
172 |
+
|
173 |
+
//The sale adverts content starts here
|
174 |
+
'blackfriday' => array(
|
175 |
+
'prefix' => '',
|
176 |
+
'title' => __('Black Friday - 20% off UpdraftPlus Premium until November 30th', 'updraftplus'),
|
177 |
+
'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
|
178 |
+
'image' => 'notices/black_friday.png',
|
179 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
180 |
+
'button_meta' => 'updraftplus',
|
181 |
+
'dismiss_time' => 'dismiss_season',
|
182 |
+
'discount_code' => 'blackfridaysale2016',
|
183 |
+
'valid_from' => '2016-11-23 00:00:00',
|
184 |
+
'valid_to' => '2016-11-30 23:59:59',
|
185 |
+
'supported_positions' => $dashboard_top_or_report,
|
186 |
+
),
|
187 |
+
'christmas' => array(
|
188 |
+
'prefix' => '',
|
189 |
+
'title' => __('Christmas sale - 20% off UpdraftPlus Premium until December 25th', 'updraftplus'),
|
190 |
+
'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
|
191 |
+
'image' => 'notices/christmas.png',
|
192 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
193 |
+
'button_meta' => 'updraftplus',
|
194 |
+
'dismiss_time' => 'dismiss_season',
|
195 |
+
'discount_code' => 'christmassale2016',
|
196 |
+
'valid_from' => '2016-12-01 00:00:00',
|
197 |
+
'valid_to' => '2016-12-25 23:59:59',
|
198 |
+
'supported_positions' => $dashboard_top_or_report,
|
199 |
+
),
|
200 |
+
'newyear' => array(
|
201 |
+
'prefix' => '',
|
202 |
+
'title' => __('Happy New Year - 20% off UpdraftPlus Premium until January 1st', 'updraftplus'),
|
203 |
+
'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
|
204 |
+
'image' => 'notices/new_year.png',
|
205 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
206 |
+
'button_meta' => 'updraftplus',
|
207 |
+
'dismiss_time' => 'dismiss_season',
|
208 |
+
'discount_code' => 'newyearsale2017',
|
209 |
+
'valid_from' => '2016-12-26 00:00:00',
|
210 |
+
'valid_to' => '2017-01-01 23:59:59',
|
211 |
+
'supported_positions' => $dashboard_top_or_report,
|
212 |
+
),
|
213 |
+
'spring' => array(
|
214 |
+
'prefix' => '',
|
215 |
+
'title' => __('Spring sale - 20% off UpdraftPlus Premium until April 31st', 'updraftplus'),
|
216 |
+
'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
|
217 |
+
'image' => 'notices/spring.png',
|
218 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
219 |
+
'button_meta' => 'updraftplus',
|
220 |
+
'dismiss_time' => 'dismiss_season',
|
221 |
+
'discount_code' => 'springsale2017',
|
222 |
+
'valid_from' => '2017-04-01 00:00:00',
|
223 |
+
'valid_to' => '2017-04-30 23:59:59',
|
224 |
+
'supported_positions' => $dashboard_top_or_report,
|
225 |
+
),
|
226 |
+
'summer' => array(
|
227 |
+
'prefix' => '',
|
228 |
+
'title' => __('Summer sale 20% off UpdraftPlus Premium until July 31st', 'updraftplus'),
|
229 |
+
'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
|
230 |
+
'image' => 'notices/summer.png',
|
231 |
+
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
|
232 |
+
'button_meta' => 'updraftplus',
|
233 |
+
'dismiss_time' => 'dismiss_season',
|
234 |
+
'discount_code' => 'summersale2017',
|
235 |
+
'valid_from' => '2017-07-01 00:00:00',
|
236 |
+
'valid_to' => '2017-07-31 23:59:59',
|
237 |
+
'supported_positions' => $dashboard_top_or_report,
|
238 |
+
),
|
239 |
+
);
|
240 |
+
}
|
241 |
+
|
242 |
+
// Call this method to setup the notices
|
243 |
+
public static function notices_init() {
|
244 |
+
if (self::$initialized) return;
|
245 |
+
self::$initialized = true;
|
246 |
+
self::$notices_content = (defined('UPDRAFTPLUS_NOADS_B') && UPDRAFTPLUS_NOADS_B) ? array() : self::populate_notices_content();
|
247 |
+
global $updraftplus;
|
248 |
+
$our_version = @constant('SCRIPT_DEBUG') ? $updraftplus->version.'.'.time() : $updraftplus->version;
|
249 |
+
wp_enqueue_style('updraftplus-notices-css', UPDRAFTPLUS_URL.'/css/updraftplus-notices.css', array(), $our_version);
|
250 |
+
}
|
251 |
+
|
252 |
+
private static function translation_needed() {
|
253 |
+
$wplang = get_locale();
|
254 |
+
if (strlen($wplang) < 1 || $wplang == 'en_US' || $wplang == 'en_GB') return false;
|
255 |
+
if (defined('WP_LANG_DIR') && is_file(WP_LANG_DIR.'/plugins/updraftplus-'.$wplang.'.mo')) return false;
|
256 |
+
if (is_file(UPDRAFTPLUS_DIR.'/languages/updraftplus-'.$wplang.'.mo')) return false;
|
257 |
+
return true;
|
258 |
+
}
|
259 |
+
|
260 |
+
private static function url_start($html_allowed = false, $url, $https = false) {
|
261 |
+
$proto = ($https) ? 'https' : 'http';
|
262 |
+
if (strpos($url, 'updraftplus.com') !== false){
|
263 |
+
return $html_allowed ? "<a href=".apply_filters('updraftplus_com_link',$proto.'://'.$url).">" : "";
|
264 |
+
}else{
|
265 |
+
return $html_allowed ? "<a href=\"$proto://$url\">" : "";
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
private static function url_end($html_allowed, $url, $https = false) {
|
270 |
+
$proto = ($https) ? 'https' : 'http';
|
271 |
+
return $html_allowed ? '</a>' : " ($proto://$url)";
|
272 |
+
}
|
273 |
+
|
274 |
+
public static function do_notice($notice = false, $position = 'top', $return_instead_of_echo = false) {
|
275 |
+
|
276 |
+
self::notices_init();
|
277 |
+
|
278 |
+
if (false === $notice) $notice = defined('UPDRAFTPLUS_NOTICES_FORCE_ID') ? UPDRAFTPLUS_NOTICES_FORCE_ID : $notice;
|
279 |
+
|
280 |
+
$notice_content = self::get_notice_data($notice, $position);
|
281 |
+
|
282 |
+
if (false != $notice_content) {
|
283 |
+
return self::render_specified_notice($notice_content, $return_instead_of_echo, $position);
|
284 |
+
}
|
285 |
+
}
|
286 |
+
|
287 |
+
/*
|
288 |
+
This method will return a notice ready for display.
|
289 |
+
*/
|
290 |
+
private static function get_notice_data($notice = false, $position = 'top') {
|
291 |
+
|
292 |
+
/*
|
293 |
+
We need to check the database to see if any notices have been dismissed and if they have check if the time they have been dismissed for has passed, otherwise we shouldn't display the notices
|
294 |
+
*/
|
295 |
+
|
296 |
+
$time_now = defined('UPDRAFTPLUS_NOTICES_FORCE_TIME') ? UPDRAFTPLUS_NOTICES_FORCE_TIME : time();
|
297 |
+
|
298 |
+
$notice_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('dismissed_general_notices_until', 0));
|
299 |
+
$seasonal_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('dismissed_season_notices_until', 0));
|
300 |
+
$autobackup_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('updraftplus_dismissedautobackup', 0));
|
301 |
+
|
302 |
+
// If a specific notice has been passed to this method then return that notice.
|
303 |
+
if ($notice) {
|
304 |
+
if (!isset(self::$notices_content[$notice])) return false;
|
305 |
+
|
306 |
+
// Does the notice support the position specified?
|
307 |
+
if (isset(self::$notices_content[$notice]['supported_positions']) && !in_array($position, self::$notices_content[$notice]['supported_positions'])) return false;
|
308 |
+
|
309 |
+
/*
|
310 |
+
first check if the advert passed can be displayed and hasn't been dismissed, we do this by checking what dismissed value we should be checking.
|
311 |
+
*/
|
312 |
+
$dismiss_time = self::$notices_content[$notice]['dismiss_time'];
|
313 |
+
|
314 |
+
if ('dismiss_notice' == $dismiss_time) $dismiss = $notice_dismiss;
|
315 |
+
if ('dismiss_season' == $dismiss_time) $dismiss = $seasonal_dismiss;
|
316 |
+
if ('dismissautobackup' == $dismiss_time) $dismiss = $autobackup_dismiss;
|
317 |
+
|
318 |
+
if (!empty($dismiss)) return false;
|
319 |
+
|
320 |
+
return self::$notices_content[$notice];
|
321 |
+
}
|
322 |
+
|
323 |
+
//create an array to add non-seasonal adverts to so that if a seasonal advert can't be returned we can choose a random advert from this array.
|
324 |
+
$available_notices = array();
|
325 |
+
|
326 |
+
//If Advert wasn't passed then next we should check to see if a seasonal advert can be returned.
|
327 |
+
foreach (self::$notices_content as $notice_id => $notice_data) {
|
328 |
+
// Does the notice support the position specified?
|
329 |
+
if (isset(self::$notices_content[$notice_id]['supported_positions']) && !in_array($position, self::$notices_content[$notice_id]['supported_positions'])) continue;
|
330 |
+
|
331 |
+
// If the advert has a validity function, then require the advert to be valid
|
332 |
+
if (!empty($notice_data['validity_function']) && !call_user_func(array('UpdraftPlus_Notices', $notice_data['validity_function']))) continue;
|
333 |
+
|
334 |
+
global $updraftplus;
|
335 |
+
|
336 |
+
if (isset($notice_data['valid_from']) && isset($notice_data['valid_to'])) {
|
337 |
+
// Do not show seasonal notices to people with an updraftplus.com version and no-addons yet
|
338 |
+
if (!file_exists(UPDRAFTPLUS_DIR.'/udaddons') || $updraftplus->have_addons) {
|
339 |
+
$valid_from = strtotime($notice_data['valid_from']);
|
340 |
+
$valid_to = strtotime($notice_data['valid_to']);
|
341 |
+
if (($time_now >= $valid_from && $time_now <= $valid_to) && !$seasonal_dismiss) {
|
342 |
+
return $notice_data;
|
343 |
+
}
|
344 |
+
}
|
345 |
+
} else {
|
346 |
+
|
347 |
+
$dismiss = false;
|
348 |
+
$dismiss_time = self::$notices_content[$notice_id]['dismiss_time'];
|
349 |
+
if ('dismiss_notice' == $dismiss_time) $dismiss = $notice_dismiss;
|
350 |
+
if ('dismiss_season' == $dismiss_time) $dismiss = $seasonal_dismiss;
|
351 |
+
if ('dismissautobackup' == $dismiss_time) $dismiss = $autobackup_dismiss;
|
352 |
+
|
353 |
+
if (!$dismiss) $available_notices[$notice_id] = $notice_data;
|
354 |
+
}
|
355 |
+
}
|
356 |
+
|
357 |
+
if (empty($available_notices)) return false;
|
358 |
+
|
359 |
+
//If a seasonal advert can't be returned then we will return a random advert
|
360 |
+
|
361 |
+
/*
|
362 |
+
Using shuffle here as something like rand which produces a random number and uses that as the array index fails, this is because in future an advert may not be numbered and could have a string as its key which will then cause errors.
|
363 |
+
*/
|
364 |
+
shuffle($available_notices);
|
365 |
+
return $available_notices[0];
|
366 |
+
|
367 |
+
}
|
368 |
+
|
369 |
+
private static function render_specified_notice($advert_information, $return_instead_of_echo = false, $position = 'top') {
|
370 |
+
global $updraftplus_admin;
|
371 |
+
|
372 |
+
if ('bottom' == $position) {
|
373 |
+
$template_file = 'bottom-notice.php';
|
374 |
+
} elseif ('report' == $position) {
|
375 |
+
$template_file = 'report.php';
|
376 |
+
} elseif ('report-plain' == $position) {
|
377 |
+
$template_file = 'report-plain.php';
|
378 |
+
} else {
|
379 |
+
$template_file = 'horizontal-notice.php';
|
380 |
+
}
|
381 |
+
|
382 |
+
return $updraftplus_admin->include_template('wp-admin/notices/'.$template_file, $return_instead_of_echo, $advert_information);
|
383 |
+
}
|
384 |
+
}
|
methods/dropbox.php
CHANGED
@@ -98,7 +98,8 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
98 |
return false;
|
99 |
}
|
100 |
|
101 |
-
|
|
|
102 |
|
103 |
if (empty($opts['tk_request_token'])) {
|
104 |
$updraftplus->log("Dropbox: begin cloud upload (using API version $use_api_ver with OAuth v2 token)");
|
@@ -187,8 +188,8 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
187 |
|
188 |
// We don't actually abort now - there's no harm in letting it try and then fail
|
189 |
if ($available_quota != -1 && $available_quota < ($filesize-$offset)) {
|
190 |
-
$updraftplus->log("File upload expected to fail: file data remaining to upload ($file) size is ".($filesize-$offset)." b (overall file size; $filesize b), whereas available quota is only $available_quota b");
|
191 |
-
|
192 |
}
|
193 |
|
194 |
// Old-style, single file put: $put = $dropbox->putFile($updraft_dir.'/'.$file, $dropbox_folder.$file);
|
@@ -290,7 +291,9 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
290 |
$search = $dropbox->search($match, $searchpath);
|
291 |
} catch (Exception $e) {
|
292 |
$updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
|
293 |
-
|
|
|
|
|
294 |
}
|
295 |
|
296 |
if (empty($search['code']) || 200 != $search['code']) return new WP_Error('response_error', sprintf(__('%s returned an unexpected HTTP response: %s', 'updraftplus'), 'Dropbox', $search['code']), $search['body']);
|
@@ -308,7 +311,8 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
308 |
$results = array();
|
309 |
|
310 |
foreach ($matches as $item) {
|
311 |
-
|
|
|
312 |
if (!is_object($item)) continue;
|
313 |
|
314 |
if ((!isset($item->bytes) || $item->bytes > 0) && empty($item->is_dir) && !empty($item->path) && 0 === strpos($item->path, $searchpath)) {
|
@@ -614,7 +618,8 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
614 |
/*
|
615 |
Quota information is no longer provided with account information a new call to qoutaInfo must be made to get this information.
|
616 |
*/
|
617 |
-
|
|
|
618 |
$quotaInfo = $accountInfo;
|
619 |
} else {
|
620 |
$quotaInfo = $dropbox->quotaInfo();
|
@@ -669,7 +674,7 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
669 |
/*
|
670 |
Use Old Dropbox API constant is used to force bootstrap to use the old API this is for users having problems. By default we will use the new Dropbox API v2 as the old version will be deprecated as of June 2017
|
671 |
*/
|
672 |
-
$dropbox_api = (defined('UPDRAFTPLUS_DROPBOX_API_V1') && UPDRAFTPLUS_DROPBOX_API_V1) ? 'Dropbox' : 'Dropbox2';
|
673 |
|
674 |
require_once(UPDRAFTPLUS_DIR.'/includes/'.$dropbox_api.'/API.php');
|
675 |
require_once(UPDRAFTPLUS_DIR.'/includes/'.$dropbox_api.'/Exception.php');
|
98 |
return false;
|
99 |
}
|
100 |
|
101 |
+
// 28 June 2017
|
102 |
+
$use_api_ver = (defined('UPDRAFTPLUS_DROPBOX_API_V1') && UPDRAFTPLUS_DROPBOX_API_V1 && time() < 1498608000) ? 1 : 2;
|
103 |
|
104 |
if (empty($opts['tk_request_token'])) {
|
105 |
$updraftplus->log("Dropbox: begin cloud upload (using API version $use_api_ver with OAuth v2 token)");
|
188 |
|
189 |
// We don't actually abort now - there's no harm in letting it try and then fail
|
190 |
if ($available_quota != -1 && $available_quota < ($filesize-$offset)) {
|
191 |
+
$updraftplus->log("File upload expected to fail: file data remaining to upload ($file) size is ".($filesize-$offset)." b (overall file size; .".($filesize*1024)." b), whereas available quota is only $available_quota b");
|
192 |
+
// $updraftplus->log(sprintf(__("Account full: your %s account has only %d bytes left, but the file to be uploaded has %d bytes remaining (total size: %d bytes)",'updraftplus'),'Dropbox', $available_quota, $filesize-$offset, $filesize), 'warning');
|
193 |
}
|
194 |
|
195 |
// Old-style, single file put: $put = $dropbox->putFile($updraft_dir.'/'.$file, $dropbox_folder.$file);
|
291 |
$search = $dropbox->search($match, $searchpath);
|
292 |
} catch (Exception $e) {
|
293 |
$updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
|
294 |
+
// The most likely cause of a search_error is specifying a non-existent path, which should just result in an empty result set.
|
295 |
+
// return new WP_Error('search_error', $e->getMessage());
|
296 |
+
return array();
|
297 |
}
|
298 |
|
299 |
if (empty($search['code']) || 200 != $search['code']) return new WP_Error('response_error', sprintf(__('%s returned an unexpected HTTP response: %s', 'updraftplus'), 'Dropbox', $search['code']), $search['body']);
|
311 |
$results = array();
|
312 |
|
313 |
foreach ($matches as $item) {
|
314 |
+
// 28 June 2017 - https://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/
|
315 |
+
if (defined('UPDRAFTPLUS_DROPBOX_API_V1') && UPDRAFTPLUS_DROPBOX_API_V1 && time() < 1498608000) {
|
316 |
if (!is_object($item)) continue;
|
317 |
|
318 |
if ((!isset($item->bytes) || $item->bytes > 0) && empty($item->is_dir) && !empty($item->path) && 0 === strpos($item->path, $searchpath)) {
|
618 |
/*
|
619 |
Quota information is no longer provided with account information a new call to qoutaInfo must be made to get this information.
|
620 |
*/
|
621 |
+
// 28 June 2017 - https://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/
|
622 |
+
if (defined('UPDRAFTPLUS_DROPBOX_API_V1') && UPDRAFTPLUS_DROPBOX_API_V1 && time() < 1498608000) {
|
623 |
$quotaInfo = $accountInfo;
|
624 |
} else {
|
625 |
$quotaInfo = $dropbox->quotaInfo();
|
674 |
/*
|
675 |
Use Old Dropbox API constant is used to force bootstrap to use the old API this is for users having problems. By default we will use the new Dropbox API v2 as the old version will be deprecated as of June 2017
|
676 |
*/
|
677 |
+
$dropbox_api = (defined('UPDRAFTPLUS_DROPBOX_API_V1') && UPDRAFTPLUS_DROPBOX_API_V1 && time() < 1498608000) ? 'Dropbox' : 'Dropbox2';
|
678 |
|
679 |
require_once(UPDRAFTPLUS_DIR.'/includes/'.$dropbox_api.'/API.php');
|
680 |
require_once(UPDRAFTPLUS_DIR.'/includes/'.$dropbox_api.'/Exception.php');
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== UpdraftPlus WordPress Backup Plugin ===
|
2 |
-
Contributors: Backup with UpdraftPlus, DavidAnderson, DNutbourne, aporter,
|
3 |
Tags: backup, backups, restore, amazon backup, s3 backup, dropbox backup, google drive backup, rackspace cloud files, rackspace backup, dreamhost, dreamobjects backup, ftp backup, webdav backup, google cloud storage, onedrive, azure, back up, multisite, restoration, sftp backup, ftps, scp backup, migrate, duplicate, copy, mysql backup, database backup, db backups, website backup, wordpress backup, full backup, openstack backup, sicherung
|
4 |
Requires at least: 3.2
|
5 |
Tested up to: 4.6
|
6 |
-
Stable tag: 1.12.
|
7 |
Author URI: https://updraftplus.com
|
8 |
Donate link: http://david.dw-perspective.org.uk/donate
|
9 |
License: GPLv3 or later
|
@@ -127,10 +127,28 @@ The <a href="https://updraftplus.com/news/">UpdraftPlus backup blog</a> is the b
|
|
127 |
|
128 |
N.B. Paid versions of UpdraftPlus Backup / Restore have a version number which is 1 higher in the first digit, and has an extra component on the end, but the changelog below still applies. i.e. changes listed for 1.12.24 of the free version correspond to changes made in 2.12.24.x of the paid version.
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
= 1.12.25 - 12/Nov/2016 =
|
131 |
|
132 |
* COMPATIBILITY: Dropbox APIv2 capability (see: https://updraftplus.com/dropbox-api-version-1-deprecation/) in 1.12.24 was not complete - this release now avoids all APIv1 use
|
133 |
* TWEAK: The 'site information' advanced tool now contains information on loaded Apache modules.
|
|
|
134 |
|
135 |
= 1.12.24 - 08/Nov/2016 =
|
136 |
|
@@ -143,7 +161,7 @@ N.B. Paid versions of UpdraftPlus Backup / Restore have a version number which i
|
|
143 |
* TWEAK: Deleting remote backup sets from the dashboard is now batched for sets with many archives, to avoid potential PHP timeouts on slow remote services
|
144 |
* TWEAK: Updated bundled phpseclib library to version 1.0.4
|
145 |
* TWEAK: Introduce an internal templating layer, for improved long-term maintainability
|
146 |
-
* TWEAK: When importing a single site into a
|
147 |
* TWEAK: Fix an inconsequential off-by-one in the chunked downloading algorithm so that the behaviour is as documented
|
148 |
* TWEAK: Improve accessibility of Labelauty components with keyboard navigation
|
149 |
* TWEAK: Tweak the algorithm for scheduling resumptions, to improve efficiency in the (once) seen corner-case of PHP usually having a predictable run-time, but with an instance of a much longer run-time
|
@@ -338,4 +356,4 @@ We recognise and thank the following for code and/or libraries used and/or modif
|
|
338 |
|
339 |
|
340 |
== Upgrade Notice ==
|
341 |
-
* 1.12.
|
1 |
=== UpdraftPlus WordPress Backup Plugin ===
|
2 |
+
Contributors: Backup with UpdraftPlus, DavidAnderson, DNutbourne, aporter, snightingale
|
3 |
Tags: backup, backups, restore, amazon backup, s3 backup, dropbox backup, google drive backup, rackspace cloud files, rackspace backup, dreamhost, dreamobjects backup, ftp backup, webdav backup, google cloud storage, onedrive, azure, back up, multisite, restoration, sftp backup, ftps, scp backup, migrate, duplicate, copy, mysql backup, database backup, db backups, website backup, wordpress backup, full backup, openstack backup, sicherung
|
4 |
Requires at least: 3.2
|
5 |
Tested up to: 4.6
|
6 |
+
Stable tag: 1.12.28
|
7 |
Author URI: https://updraftplus.com
|
8 |
Donate link: http://david.dw-perspective.org.uk/donate
|
9 |
License: GPLv3 or later
|
127 |
|
128 |
N.B. Paid versions of UpdraftPlus Backup / Restore have a version number which is 1 higher in the first digit, and has an extra component on the end, but the changelog below still applies. i.e. changes listed for 1.12.24 of the free version correspond to changes made in 2.12.24.x of the paid version.
|
129 |
|
130 |
+
1.12.28 - 21/Nov/2016
|
131 |
+
|
132 |
+
* TWEAK: The UPDRAFTPLUS_DROPBOX_API_V1 constant will be ignored from 28th June 2017 (when Dropbox turn off that API entirely)
|
133 |
+
* TWEAK: A new internal infrastructure for handling user-visible notices in the dashboard and reports
|
134 |
+
* TWEAK: Small layout tweak to fix a malformatted error message
|
135 |
+
|
136 |
+
1.12.27 - 17/Nov/2016
|
137 |
+
|
138 |
+
* FIX: The WP 4.7 compatibility tweak in 1.12.26 introduced a regression that caused the question to appear when unwanted on other WP versions.
|
139 |
+
|
140 |
+
1.12.26 - 16/Nov/2016
|
141 |
+
|
142 |
+
* COMPATIBILITY: On WordPress 4.7, the behaviour of shiny updates has changed, necessitating a small tweak to prevent an unwanted "do you really want to move away from this page?" question from the browser on the updates/plugins pages in some situations.
|
143 |
+
* TWEAK: When the Dropbox quota state seems to imply that the next upload will fail, do not register this as an error before it actually happens.
|
144 |
+
* TWEAK: When an error occurs when re-scanning Dropbox, make sure the error details are logged in the browser developer console
|
145 |
+
* FIX: Fix ability to rescan a Dropbox sub-folder (regression in 1.12.25)
|
146 |
+
|
147 |
= 1.12.25 - 12/Nov/2016 =
|
148 |
|
149 |
* COMPATIBILITY: Dropbox APIv2 capability (see: https://updraftplus.com/dropbox-api-version-1-deprecation/) in 1.12.24 was not complete - this release now avoids all APIv1 use
|
150 |
* TWEAK: The 'site information' advanced tool now contains information on loaded Apache modules.
|
151 |
+
* TWEAK: Small layout tweak to fix a malformatted error message
|
152 |
|
153 |
= 1.12.24 - 08/Nov/2016 =
|
154 |
|
161 |
* TWEAK: Deleting remote backup sets from the dashboard is now batched for sets with many archives, to avoid potential PHP timeouts on slow remote services
|
162 |
* TWEAK: Updated bundled phpseclib library to version 1.0.4
|
163 |
* TWEAK: Introduce an internal templating layer, for improved long-term maintainability
|
164 |
+
* TWEAK: When importing a single site into a multisite install as a new site, remove any cron entries for backup runs on the new site
|
165 |
* TWEAK: Fix an inconsequential off-by-one in the chunked downloading algorithm so that the behaviour is as documented
|
166 |
* TWEAK: Improve accessibility of Labelauty components with keyboard navigation
|
167 |
* TWEAK: Tweak the algorithm for scheduling resumptions, to improve efficiency in the (once) seen corner-case of PHP usually having a predictable run-time, but with an instance of a much longer run-time
|
356 |
|
357 |
|
358 |
== Upgrade Notice ==
|
359 |
+
* 1.12.28: Minor Dropbox APIv2 tweaks, plus some internal structure improvements.
|
templates/wp-admin/notices/bottom-notice.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed'); ?>
|
2 |
+
|
3 |
+
<div class="updraft_advert_bottom">
|
4 |
+
<div class="updraft_advert_content_right">
|
5 |
+
<h4 class="updraft_advert_heading">
|
6 |
+
<?php
|
7 |
+
if (!empty($prefix)) echo $prefix.' ';
|
8 |
+
echo $title;
|
9 |
+
?>
|
10 |
+
</h4>
|
11 |
+
<p>
|
12 |
+
<?php
|
13 |
+
echo $text;
|
14 |
+
|
15 |
+
if (isset($discount_code)) echo ' <b>' . $discount_code . '</b>';
|
16 |
+
|
17 |
+
// if (isset($text2)) {
|
18 |
+
// echo '</p><p>' . $text2 . '</p><p>';
|
19 |
+
// }
|
20 |
+
|
21 |
+
if (!empty($button_link) && !empty($button_meta)) {
|
22 |
+
?>
|
23 |
+
<a class="updraft_notice_link" href="<?php esc_attr_e(apply_filters('updraftplus_com_link',$button_link));?>"><?php
|
24 |
+
if ($button_meta == 'updraftcentral') {
|
25 |
+
_e('Get UpdraftCentral', 'updraftplus');
|
26 |
+
} elseif ($button_meta == 'review') {
|
27 |
+
_e('Review UpdraftPlus', 'updraftplus');
|
28 |
+
} elseif ($button_meta == 'updraftplus') {
|
29 |
+
_e('Get Premium', 'updraftplus');
|
30 |
+
} elseif ($button_meta == 'signup') {
|
31 |
+
_e('Sign up', 'updraftplus');
|
32 |
+
} elseif ($button_meta == 'go_there') {
|
33 |
+
_e('Go there', 'updraftplus');
|
34 |
+
}
|
35 |
+
?></a>
|
36 |
+
<?php } ?>
|
37 |
+
</p>
|
38 |
+
</div>
|
39 |
+
<div class="clear"></div>
|
40 |
+
</div>
|
templates/wp-admin/notices/horizontal-notice.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed'); ?>
|
2 |
+
|
3 |
+
<div class="updraft-ad-container updated">
|
4 |
+
<div class="updraft_notice_container">
|
5 |
+
<div class="updraft_advert_content_left">
|
6 |
+
<img src="<?php echo UPDRAFTPLUS_URL.'/images/'.$image;?>" width="60" height="60" alt="<?php _e('notice image','updraftplus');?>" />
|
7 |
+
</div>
|
8 |
+
<div class="updraft_advert_content_right">
|
9 |
+
<h3 class="updraft_advert_heading">
|
10 |
+
<?php
|
11 |
+
if (!empty($prefix)) echo $prefix.' ';
|
12 |
+
echo $title;
|
13 |
+
?>
|
14 |
+
<div class="updraft-advert-dismiss">
|
15 |
+
<?php if (!empty($dismiss_time)) { ?>
|
16 |
+
<a href="#" onclick="jQuery('.updraft-ad-container').slideUp(); jQuery.post(ajaxurl, {action: 'updraft_ajax', subaction: '<?php echo $dismiss_time;?>', nonce: '<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>' });"><?php _e('Dismiss', 'updraftplus'); ?></a>
|
17 |
+
<?php } else { ?>
|
18 |
+
<a href="#" onclick="jQuery('.updraft-ad-container').slideUp();"><?php _e('Dismiss', 'updraftplus'); ?></a>
|
19 |
+
<?php } ?>
|
20 |
+
</div>
|
21 |
+
</h3>
|
22 |
+
<p>
|
23 |
+
<?php
|
24 |
+
echo $text;
|
25 |
+
|
26 |
+
if (isset($discount_code)) echo ' <b>' . $discount_code . '</b>';
|
27 |
+
|
28 |
+
// if (isset($text2)) {
|
29 |
+
// echo '</p><p>' . $text2 . '</p><p>';
|
30 |
+
// }
|
31 |
+
|
32 |
+
if (!empty($button_link) && !empty($button_meta)) {
|
33 |
+
?>
|
34 |
+
<a class="updraft_notice_link" href="<?php esc_attr_e(apply_filters('updraftplus_com_link',$button_link));?>"><?php
|
35 |
+
if ($button_meta == 'updraftcentral') {
|
36 |
+
_e('Get UpdraftCentral', 'updraftplus');
|
37 |
+
} elseif ($button_meta == 'review') {
|
38 |
+
_e('Review UpdraftPlus', 'updraftplus');
|
39 |
+
} elseif ($button_meta == 'updraftplus') {
|
40 |
+
_e('Get Premium', 'updraftplus');
|
41 |
+
} elseif ($button_meta == 'signup') {
|
42 |
|