Version Description
- Updates: Make registration section easier to use and add more status information
- Updates: Add backups section with tips and backup count
- Fix: Restore - fix to static folder property reference
Download this release
Release Info
Developer | cssimmon |
Plugin | Backup and Restore WordPress – WPBackItUp Backup Plugin |
Version | 1.10.4 |
Comparing to | |
See all releases |
Code changes from version 1.10.3 to 1.10.4
- lib/includes/class-wpbackitup-admin.php +125 -117
- lib/includes/job_restore.php +3 -3
- readme.txt +7 -2
- views/backup.php +85 -43
- wp-backitup.php +2 -2
lib/includes/class-wpbackitup-admin.php
CHANGED
@@ -49,11 +49,11 @@ class WPBackitup_Admin {
|
|
49 |
'license_expires'=> "1970-01-01 00:00:00",
|
50 |
'license_limit'=> "1",
|
51 |
'license_sitecount'=> "",
|
|
|
|
|
52 |
'notification_email' => "",
|
53 |
'backup_retained_number' => "3",
|
54 |
'lite_backup_retained_number' => "1",
|
55 |
-
'lite_registration_email' => "",
|
56 |
-
'lite_registration_first_name' => "",
|
57 |
'backup_count'=>0,
|
58 |
'successful_backup_count'=>0,
|
59 |
'stats_last_check_date'=> "1970-01-01 00:00:00",
|
@@ -142,6 +142,8 @@ class WPBackitup_Admin {
|
|
142 |
|
143 |
add_action( 'wpbackitup_run_cleanup_tasks', array( &$this,'wpbackitup_run_cleanup_tasks'));
|
144 |
|
|
|
|
|
145 |
}
|
146 |
|
147 |
/**
|
@@ -291,9 +293,9 @@ class WPBackitup_Admin {
|
|
291 |
$this->_admin_options_update();
|
292 |
}
|
293 |
|
294 |
-
if( wp_verify_nonce( $nonce, "{$this->namespace}-register
|
295 |
$logger->log('Register Lite Form Post');
|
296 |
-
$this->
|
297 |
}
|
298 |
|
299 |
if( wp_verify_nonce( $nonce, "{$this->namespace}-update-schedule" ) ) {
|
@@ -324,7 +326,7 @@ class WPBackitup_Admin {
|
|
324 |
}
|
325 |
|
326 |
public function initialize(){
|
327 |
-
|
328 |
}
|
329 |
|
330 |
public function wpbackitup_queue_scheduled_jobs(){
|
@@ -937,9 +939,9 @@ class WPBackitup_Admin {
|
|
937 |
* Process registration page form submissions
|
938 |
*
|
939 |
*/
|
940 |
-
public function
|
941 |
// Verify submission for processing using wp_nonce
|
942 |
-
if( wp_verify_nonce( $_REQUEST['_wpnonce'], "{$this->namespace}-register
|
943 |
|
944 |
/**
|
945 |
* Loop through each POSTed value and sanitize it to protect against malicious code. Please
|
@@ -947,56 +949,70 @@ class WPBackitup_Admin {
|
|
947 |
* dealt with directly.
|
948 |
*/
|
949 |
|
950 |
-
$logger = new WPBackItUp_Logger(false,null,'
|
951 |
-
$logger->log("Register WP BackItUp
|
952 |
$logger->log($_POST);
|
953 |
|
954 |
-
|
955 |
-
$
|
956 |
-
|
957 |
-
$urlparts = parse_url(site_url());
|
958 |
-
$domain = $urlparts['host'];
|
959 |
|
960 |
-
|
|
|
|
|
961 |
|
962 |
-
|
963 |
-
|
964 |
-
if(!empty($first_name)){
|
965 |
-
$this->set_option('lite_registration_first_name', $first_name);
|
966 |
-
}
|
967 |
|
968 |
-
$
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
'
|
986 |
-
'
|
987 |
-
'
|
988 |
-
'
|
989 |
-
)
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
$logger->log('Lite User Registration
|
995 |
-
|
996 |
-
$logger->log(
|
997 |
-
|
998 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
999 |
|
|
|
1000 |
}
|
1001 |
|
1002 |
// Redirect back to the options page with the message flag to show the saved message
|
@@ -1159,11 +1175,11 @@ class WPBackitup_Admin {
|
|
1159 |
break;
|
1160 |
|
1161 |
case 2:
|
1162 |
-
$this->license_type_description = '
|
1163 |
break;
|
1164 |
|
1165 |
case 3:
|
1166 |
-
$this->license_type_description = '
|
1167 |
break;
|
1168 |
}
|
1169 |
}
|
@@ -1215,17 +1231,17 @@ class WPBackitup_Admin {
|
|
1215 |
return $this->get('successful_backup_count');
|
1216 |
}
|
1217 |
|
1218 |
-
function
|
1219 |
-
return $this->get('
|
1220 |
}
|
1221 |
|
1222 |
-
function
|
1223 |
-
return $this->get('
|
1224 |
}
|
1225 |
|
1226 |
function is_lite_registered(){
|
1227 |
-
$
|
1228 |
-
if (!empty($
|
1229 |
return true;
|
1230 |
} else {
|
1231 |
return false;
|
@@ -1340,7 +1356,7 @@ class WPBackitup_Admin {
|
|
1340 |
/**
|
1341 |
* Validate License Info Once per day
|
1342 |
*/
|
1343 |
-
public function check_license(){
|
1344 |
$license_key=$this->license_key();
|
1345 |
//echo "</br>License Key:" .$license_key;
|
1346 |
|
@@ -1356,7 +1372,7 @@ class WPBackitup_Admin {
|
|
1356 |
//echo($yesterday->format('Y-m-d H:i:s') .'</br>');
|
1357 |
|
1358 |
//Validate License
|
1359 |
-
if ($license_last_check_date<$yesterday)
|
1360 |
{
|
1361 |
//echo "Validate License";
|
1362 |
$this->update_license_options($license_key);
|
@@ -1386,13 +1402,19 @@ class WPBackitup_Admin {
|
|
1386 |
$data['license_sitecount']= $this->defaults['license_sitecount'];
|
1387 |
$data['license_type']= $this->defaults['license_type'];
|
1388 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1389 |
//If no value then default to lite
|
1390 |
if (empty($license) || 'lite'== $license ){
|
1391 |
$data['license_status'] = 'free';
|
1392 |
$data['license_expires']= $this->defaults['license_expires'];
|
1393 |
$data['license_limit']= 1;
|
1394 |
$data['license_sitecount']= 1;
|
1395 |
-
$data['license_type']= 0;
|
1396 |
} else {
|
1397 |
//CALL EDD_ACTIVATE_LICENSE to get activation information
|
1398 |
$api_params = array(
|
@@ -1429,9 +1451,17 @@ class WPBackitup_Admin {
|
|
1429 |
|
1430 |
$data['license_key'] = $license;
|
1431 |
$data['license_status'] = $license_data->license;
|
|
|
|
|
|
|
|
|
|
|
1432 |
$data['license_limit'] = $license_data->license_limit;
|
1433 |
$data['license_sitecount'] = $license_data->site_count;
|
1434 |
-
$data['license_expires'] = $license_data->expires;
|
|
|
|
|
|
|
1435 |
|
1436 |
//This is how we determine the type of license because
|
1437 |
//there is no difference in EDD
|
@@ -1451,34 +1481,23 @@ class WPBackitup_Admin {
|
|
1451 |
if ($license_data->license_limit>=20) {
|
1452 |
$data['license_type'] = 3;
|
1453 |
}
|
|
|
|
|
|
|
|
|
|
|
1454 |
|
1455 |
//EDD sends back expired in the error
|
1456 |
-
if (
|
1457 |
-
|
1458 |
-
|
1459 |
-
$
|
1460 |
-
$data['license_status_message'] ='';
|
1461 |
-
|
1462 |
-
//Only expire license in current month
|
1463 |
-
$license_expire_date = $license_data->expires;
|
1464 |
-
$expire_date_array = date_parse($license_expire_date);
|
1465 |
-
$logger->log('Expire Date Array');
|
1466 |
-
$logger->log($expire_date_array);
|
1467 |
-
$logger->log('Expire Month: ' .$expire_date_array[month]);
|
1468 |
-
$logger->log('Current Month: ' .date('m'));
|
1469 |
-
|
1470 |
-
//only EXPIRE current month
|
1471 |
-
//if ($expire_date_array[month]==date('m')) {
|
1472 |
-
$data['license_status'] ='expired';
|
1473 |
-
$data['license_status_message'] ='License has expired.';
|
1474 |
-
$logger->log('Expire License.');
|
1475 |
-
//}
|
1476 |
}
|
1477 |
|
1478 |
-
if ((
|
1479 |
-
$data['license_status_message'] ='Activation limit has been reached.';
|
1480 |
}
|
1481 |
-
}
|
1482 |
}
|
1483 |
|
1484 |
$logger->log('Updating License Options');
|
@@ -1504,34 +1523,8 @@ class WPBackitup_Admin {
|
|
1504 |
// Load option values if they haven't been loaded already
|
1505 |
$wp_option_name = $this->namespace .'_' .$option_name;
|
1506 |
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
$option_value = get_option($wp_option_name);
|
1511 |
-
|
1512 |
-
//return the value
|
1513 |
-
if(isset( $option_value ) && !empty( $option_value )) return $option_value;
|
1514 |
-
|
1515 |
-
//Should only happen once
|
1516 |
-
//Can take this out in next release
|
1517 |
-
//If looking for license then migrate the old settings
|
1518 |
-
if ('license_key'==$option_name) {
|
1519 |
-
$options = get_option('_' . $this->namespace . '--options');
|
1520 |
-
$license = $options[$option_name];
|
1521 |
-
if( isset( $license ) || !empty( $license ) ) {
|
1522 |
-
//migrate to new option setting
|
1523 |
-
$this->set_option($option_name, $license);
|
1524 |
-
$this->update_license_options($license);
|
1525 |
-
|
1526 |
-
//Delete the old options
|
1527 |
-
delete_option('_' . $this->namespace . '--options');
|
1528 |
-
|
1529 |
-
return $license;
|
1530 |
-
}
|
1531 |
-
|
1532 |
-
}
|
1533 |
-
//Return the default
|
1534 |
-
return $this->defaults[$option_name];
|
1535 |
}
|
1536 |
|
1537 |
//Prefix options with namespace & save
|
@@ -1631,8 +1624,6 @@ class WPBackitup_Admin {
|
|
1631 |
*/
|
1632 |
public static function activate() {
|
1633 |
try{
|
1634 |
-
//Get rid of old job
|
1635 |
-
wp_clear_scheduled_hook('wpbackitup_check_scheduled_tasks');
|
1636 |
|
1637 |
//add cron task for once per hour starting in 1 hour
|
1638 |
if(!wp_next_scheduled( 'wpbackitup_queue_scheduled_jobs' ) ){
|
@@ -1665,6 +1656,23 @@ class WPBackitup_Admin {
|
|
1665 |
delete_option('wp-backitup_backup_batch_size');
|
1666 |
}
|
1667 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1668 |
} catch (Exception $e) {
|
1669 |
exit ('WP BackItUp encountered an error during activation.</br>' .$e->getMessage());
|
1670 |
}
|
@@ -1724,7 +1732,7 @@ class WPBackitup_Admin {
|
|
1724 |
$campaign='lite';
|
1725 |
if ($this->license_active()) $campaign='premium';
|
1726 |
|
1727 |
-
$utm_url =
|
1728 |
|
1729 |
if (!empty($content)){
|
1730 |
$utm_url .= '&utm_content=' .$content;
|
49 |
'license_expires'=> "1970-01-01 00:00:00",
|
50 |
'license_limit'=> "1",
|
51 |
'license_sitecount'=> "",
|
52 |
+
'license_customer_name' => "",
|
53 |
+
'license_customer_email' => "",
|
54 |
'notification_email' => "",
|
55 |
'backup_retained_number' => "3",
|
56 |
'lite_backup_retained_number' => "1",
|
|
|
|
|
57 |
'backup_count'=>0,
|
58 |
'successful_backup_count'=>0,
|
59 |
'stats_last_check_date'=> "1970-01-01 00:00:00",
|
142 |
|
143 |
add_action( 'wpbackitup_run_cleanup_tasks', array( &$this,'wpbackitup_run_cleanup_tasks'));
|
144 |
|
145 |
+
add_action( 'wpbackitup_check_license', array( &$this,'check_license'),10,1);
|
146 |
+
|
147 |
}
|
148 |
|
149 |
/**
|
293 |
$this->_admin_options_update();
|
294 |
}
|
295 |
|
296 |
+
if( wp_verify_nonce( $nonce, "{$this->namespace}-register" ) ) {
|
297 |
$logger->log('Register Lite Form Post');
|
298 |
+
$this->_admin_register();
|
299 |
}
|
300 |
|
301 |
if( wp_verify_nonce( $nonce, "{$this->namespace}-update-schedule" ) ) {
|
326 |
}
|
327 |
|
328 |
public function initialize(){
|
329 |
+
do_action( 'wpbackitup_check_license');
|
330 |
}
|
331 |
|
332 |
public function wpbackitup_queue_scheduled_jobs(){
|
939 |
* Process registration page form submissions
|
940 |
*
|
941 |
*/
|
942 |
+
public function _admin_register() {
|
943 |
// Verify submission for processing using wp_nonce
|
944 |
+
if( wp_verify_nonce( $_REQUEST['_wpnonce'], "{$this->namespace}-register" ) ) {
|
945 |
|
946 |
/**
|
947 |
* Loop through each POSTed value and sanitize it to protect against malicious code. Please
|
949 |
* dealt with directly.
|
950 |
*/
|
951 |
|
952 |
+
$logger = new WPBackItUp_Logger(false,null,'debug_registration');
|
953 |
+
$logger->log("Register WP BackItUp");
|
954 |
$logger->log($_POST);
|
955 |
|
956 |
+
//First lets check the license
|
957 |
+
$val = $_POST['license_key'];
|
958 |
+
$license_key = $this->_sanitize($val);
|
|
|
|
|
959 |
|
960 |
+
//activate the license if entered
|
961 |
+
$logger->log("Activate License");
|
962 |
+
$this->update_license_options($license_key);
|
963 |
|
964 |
+
//LITE users only
|
965 |
+
if ($this->license_type()=='0') {
|
|
|
|
|
|
|
966 |
|
967 |
+
$logger->log("Register WP BackItUp LITE");
|
968 |
+
|
969 |
+
$val = $_POST['license_email'];
|
970 |
+
$license_email = $this->_sanitize( $val );
|
971 |
+
if ( ! empty( $license_email ) && filter_var( $license_email, FILTER_VALIDATE_EMAIL ) ) {
|
972 |
+
$urlparts = parse_url( site_url() );
|
973 |
+
$domain = $urlparts['host'];
|
974 |
+
|
975 |
+
$license_name = $_POST['license_name'];
|
976 |
+
|
977 |
+
//save options to DB
|
978 |
+
$this->set_option( 'license_customer_email', $license_email );
|
979 |
+
if ( ! empty( $license_name ) ) {
|
980 |
+
$this->set_option( 'license_customer_name', $license_name );
|
981 |
+
}
|
982 |
+
|
983 |
+
$form_data = array(
|
984 |
+
'email' => $license_email,
|
985 |
+
'site' => $domain,
|
986 |
+
'name' => $license_name,
|
987 |
+
'time_zone' => get_option( 'timezone_string' ),
|
988 |
+
);
|
989 |
+
|
990 |
+
$url = WPBACKITUP__SECURESITE_URL; //PRD
|
991 |
+
$post_url = $url . '/api/wpbackitup/register_lite';
|
992 |
+
|
993 |
+
$logger->log( 'Lite User Registration Post URL: ' . $post_url );
|
994 |
+
$logger->log( 'Lite User Registration Post Form Data: ' );
|
995 |
+
$logger->log( $form_data );
|
996 |
+
|
997 |
+
$response = wp_remote_post( $post_url, array(
|
998 |
+
'method' => 'POST',
|
999 |
+
'timeout' => 45,
|
1000 |
+
'blocking' => true,
|
1001 |
+
'headers' => array(),
|
1002 |
+
'body' => $form_data,
|
1003 |
+
'cookies' => array()
|
1004 |
+
)
|
1005 |
+
);
|
1006 |
+
|
1007 |
+
if ( is_wp_error( $response ) ) {
|
1008 |
+
$error_message = $response->get_error_message();
|
1009 |
+
$logger->log( 'Lite User Registration Error: ' . $error_message );
|
1010 |
+
} else {
|
1011 |
+
$logger->log( 'Lite User Registered Successfully:' );
|
1012 |
+
$logger->log( $response );
|
1013 |
+
}
|
1014 |
|
1015 |
+
}
|
1016 |
}
|
1017 |
|
1018 |
// Redirect back to the options page with the message flag to show the saved message
|
1175 |
break;
|
1176 |
|
1177 |
case 2:
|
1178 |
+
$this->license_type_description = 'professional';
|
1179 |
break;
|
1180 |
|
1181 |
case 3:
|
1182 |
+
$this->license_type_description = 'premium';
|
1183 |
break;
|
1184 |
}
|
1185 |
}
|
1231 |
return $this->get('successful_backup_count');
|
1232 |
}
|
1233 |
|
1234 |
+
function license_customer_email(){
|
1235 |
+
return $this->get('license_customer_email');
|
1236 |
}
|
1237 |
|
1238 |
+
function license_customer_name(){
|
1239 |
+
return $this->get('license_customer_name');
|
1240 |
}
|
1241 |
|
1242 |
function is_lite_registered(){
|
1243 |
+
$license_email= $this->license_customer_email();
|
1244 |
+
if (!empty($license_email)) {
|
1245 |
return true;
|
1246 |
} else {
|
1247 |
return false;
|
1356 |
/**
|
1357 |
* Validate License Info Once per day
|
1358 |
*/
|
1359 |
+
public function check_license($force_check=false){
|
1360 |
$license_key=$this->license_key();
|
1361 |
//echo "</br>License Key:" .$license_key;
|
1362 |
|
1372 |
//echo($yesterday->format('Y-m-d H:i:s') .'</br>');
|
1373 |
|
1374 |
//Validate License
|
1375 |
+
if ($license_last_check_date<$yesterday || $force_check)
|
1376 |
{
|
1377 |
//echo "Validate License";
|
1378 |
$this->update_license_options($license_key);
|
1402 |
$data['license_sitecount']= $this->defaults['license_sitecount'];
|
1403 |
$data['license_type']= $this->defaults['license_type'];
|
1404 |
|
1405 |
+
//$data['license_customer_name'] = $this->defaults['license_customer_name'];
|
1406 |
+
//$data['license_customer_email'] = $this->defaults['license_customer_email'];
|
1407 |
+
|
1408 |
+
$data['license_customer_name'] = $this->license_customer_name();
|
1409 |
+
$data['license_customer_email'] = $this->license_customer_email();
|
1410 |
+
|
1411 |
//If no value then default to lite
|
1412 |
if (empty($license) || 'lite'== $license ){
|
1413 |
$data['license_status'] = 'free';
|
1414 |
$data['license_expires']= $this->defaults['license_expires'];
|
1415 |
$data['license_limit']= 1;
|
1416 |
$data['license_sitecount']= 1;
|
1417 |
+
$data['license_type']= 0;
|
1418 |
} else {
|
1419 |
//CALL EDD_ACTIVATE_LICENSE to get activation information
|
1420 |
$api_params = array(
|
1451 |
|
1452 |
$data['license_key'] = $license;
|
1453 |
$data['license_status'] = $license_data->license;
|
1454 |
+
|
1455 |
+
if (property_exists($license_data,'error')) {
|
1456 |
+
$data['license_status_message'] = $license_data->error;
|
1457 |
+
}
|
1458 |
+
|
1459 |
$data['license_limit'] = $license_data->license_limit;
|
1460 |
$data['license_sitecount'] = $license_data->site_count;
|
1461 |
+
$data['license_expires'] = $license_data->expires;
|
1462 |
+
|
1463 |
+
$data['license_customer_name'] = $license_data->customer_name;
|
1464 |
+
$data['license_customer_email'] = $license_data->customer_email;
|
1465 |
|
1466 |
//This is how we determine the type of license because
|
1467 |
//there is no difference in EDD
|
1481 |
if ($license_data->license_limit>=20) {
|
1482 |
$data['license_type'] = 3;
|
1483 |
}
|
1484 |
+
}
|
1485 |
+
|
1486 |
+
//EDD sends back expired in the error
|
1487 |
+
if (($license_data->license=='invalid')) {
|
1488 |
+
$data['license_status_message'] = 'License is invalid.';
|
1489 |
|
1490 |
//EDD sends back expired in the error
|
1491 |
+
if ($license_data->error == 'expired') {
|
1492 |
+
$data['license_status'] = 'expired';
|
1493 |
+
$data['license_status_message'] = 'License has expired.';
|
1494 |
+
$logger->log( 'Expire License.' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1495 |
}
|
1496 |
|
1497 |
+
if ( ( $license_data->error == 'no_activations_left' ) ) {
|
1498 |
+
$data['license_status_message'] = 'Activation limit has been reached.';
|
1499 |
}
|
1500 |
+
}
|
1501 |
}
|
1502 |
|
1503 |
$logger->log('Updating License Options');
|
1523 |
// Load option values if they haven't been loaded already
|
1524 |
$wp_option_name = $this->namespace .'_' .$option_name;
|
1525 |
|
1526 |
+
$option_value = get_option($wp_option_name,$this->defaults[$option_name]);
|
1527 |
+
return $option_value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1528 |
}
|
1529 |
|
1530 |
//Prefix options with namespace & save
|
1624 |
*/
|
1625 |
public static function activate() {
|
1626 |
try{
|
|
|
|
|
1627 |
|
1628 |
//add cron task for once per hour starting in 1 hour
|
1629 |
if(!wp_next_scheduled( 'wpbackitup_queue_scheduled_jobs' ) ){
|
1656 |
delete_option('wp-backitup_backup_batch_size');
|
1657 |
}
|
1658 |
|
1659 |
+
//Migrate old properties - can be removed in a few releases
|
1660 |
+
$old_lite_name = get_option('wp-backitup_lite_registration_first_name');
|
1661 |
+
if ($old_lite_name) {
|
1662 |
+
update_option('wp-backitup_license_customer_name','test');
|
1663 |
+
delete_option('wp-backitup_lite_registration_first_name');
|
1664 |
+
}
|
1665 |
+
|
1666 |
+
$old_lite_email = get_option('wp-backitup_lite_registration_email');
|
1667 |
+
if ($old_lite_email) {
|
1668 |
+
update_option('wp-backitup_license_customer_email',$old_lite_email);
|
1669 |
+
delete_option('wp-backitup_lite_registration_email');
|
1670 |
+
}
|
1671 |
+
//--END Migrate
|
1672 |
+
|
1673 |
+
|
1674 |
+
do_action( 'wpbackitup_check_license',true);
|
1675 |
+
|
1676 |
} catch (Exception $e) {
|
1677 |
exit ('WP BackItUp encountered an error during activation.</br>' .$e->getMessage());
|
1678 |
}
|
1732 |
$campaign='lite';
|
1733 |
if ($this->license_active()) $campaign='premium';
|
1734 |
|
1735 |
+
$utm_url = WPBACKITUP__SECURESITE_URL .'/' .$page .'/?utm_medium=' .$medium . '&utm_source=' .$source .'&utm_campaign=' .$campaign;
|
1736 |
|
1737 |
if (!empty($content)){
|
1738 |
$utm_url .= '&utm_content=' .$content;
|
lib/includes/job_restore.php
CHANGED
@@ -467,7 +467,7 @@ if ('task_stage_wpcontent'==$current_task) {
|
|
467 |
//Stage all but plugins
|
468 |
|
469 |
$logger->log('*STAGE THEMES*');
|
470 |
-
$from_folder_name = $wp_restore->get_restore_root_folder_path() .'/'
|
471 |
$to_folder_name = WPBACKITUP__THEMES_ROOT_PATH . $folder_stage_suffix;
|
472 |
if (! $wp_restore->rename_folder($from_folder_name,$to_folder_name)){
|
473 |
fatal_error($task,'219','Cant stage themes.',false);
|
@@ -477,7 +477,7 @@ if ('task_stage_wpcontent'==$current_task) {
|
|
477 |
$logger->log('*END STAGE THEMES*');
|
478 |
|
479 |
$logger->log('*STAGE UPLOADS*');
|
480 |
-
$from_folder_name = $wp_restore->get_restore_root_folder_path() .'/'
|
481 |
$upload_array = wp_upload_dir();
|
482 |
$uploads_root_path = $upload_array['basedir'];
|
483 |
$to_folder_name = $uploads_root_path . $folder_stage_suffix;
|
@@ -489,7 +489,7 @@ if ('task_stage_wpcontent'==$current_task) {
|
|
489 |
$logger->log('*END STAGE UPLOADS*');
|
490 |
|
491 |
$logger->log('*STAGE OTHER FOLDERS*');
|
492 |
-
$other_list = glob($wp_restore->get_restore_root_folder_path() .'/'
|
493 |
foreach ( $other_list as $from_folder_name ) {
|
494 |
$to_folder_name = WPBACKITUP__CONTENT_PATH .'/' .basename($from_folder_name) . $folder_stage_suffix;
|
495 |
if (! $wp_restore->rename_folder($from_folder_name,$to_folder_name)) {
|
467 |
//Stage all but plugins
|
468 |
|
469 |
$logger->log('*STAGE THEMES*');
|
470 |
+
$from_folder_name = $wp_restore->get_restore_root_folder_path() .'/' .WPBackItUp_Restore::THEMESPATH;
|
471 |
$to_folder_name = WPBACKITUP__THEMES_ROOT_PATH . $folder_stage_suffix;
|
472 |
if (! $wp_restore->rename_folder($from_folder_name,$to_folder_name)){
|
473 |
fatal_error($task,'219','Cant stage themes.',false);
|
477 |
$logger->log('*END STAGE THEMES*');
|
478 |
|
479 |
$logger->log('*STAGE UPLOADS*');
|
480 |
+
$from_folder_name = $wp_restore->get_restore_root_folder_path() .'/' .WPBackItUp_Restore::UPLOADPATH;
|
481 |
$upload_array = wp_upload_dir();
|
482 |
$uploads_root_path = $upload_array['basedir'];
|
483 |
$to_folder_name = $uploads_root_path . $folder_stage_suffix;
|
489 |
$logger->log('*END STAGE UPLOADS*');
|
490 |
|
491 |
$logger->log('*STAGE OTHER FOLDERS*');
|
492 |
+
$other_list = glob($wp_restore->get_restore_root_folder_path() .'/' .WPBackItUp_Restore::OTHERPATH .'/*',GLOB_ONLYDIR|GLOB_NOSORT);
|
493 |
foreach ( $other_list as $from_folder_name ) {
|
494 |
$to_folder_name = WPBACKITUP__CONTENT_PATH .'/' .basename($from_folder_name) . $folder_stage_suffix;
|
495 |
if (! $wp_restore->rename_folder($from_folder_name,$to_folder_name)) {
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: cssimmon,jcpeden
|
|
3 |
Donate link: http://www.wpbackitup.com
|
4 |
Tags: backup, back up, backups, backup wordpress, backup database, backup plugin, backup and restore, database, database backup, database restore, db, db backup, db restore, download database, full backup, mysql backup, restore, restore database,restore wordpress, restore wordpress backup,restoring wordpress, website backup, wordpress backup, wordpress restore, plugin, backup buddy
|
5 |
Requires at least: 3.8.0
|
6 |
-
Tested up to: 4.1
|
7 |
-
Stable tag: 1.10.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -151,6 +151,11 @@ Our online documentation and full list of FAQs can be found at [www.wpbackitup.c
|
|
151 |
|
152 |
|
153 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
154 |
= 1.10.3 =
|
155 |
* Update: Add ticket id to support view.
|
156 |
* Fix: Add UTF Encoding on file names being backed up and restored
|
3 |
Donate link: http://www.wpbackitup.com
|
4 |
Tags: backup, back up, backups, backup wordpress, backup database, backup plugin, backup and restore, database, database backup, database restore, db, db backup, db restore, download database, full backup, mysql backup, restore, restore database,restore wordpress, restore wordpress backup,restoring wordpress, website backup, wordpress backup, wordpress restore, plugin, backup buddy
|
5 |
Requires at least: 3.8.0
|
6 |
+
Tested up to: 4.1.1
|
7 |
+
Stable tag: 1.10.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
151 |
|
152 |
|
153 |
== Changelog ==
|
154 |
+
= 1.10.4 =
|
155 |
+
* Updates: Make registration section easier to use and add more status information
|
156 |
+
* Updates: Add backups section with tips and backup count
|
157 |
+
* Fix: Restore - fix to static folder property reference
|
158 |
+
|
159 |
= 1.10.3 =
|
160 |
* Update: Add ticket id to support view.
|
161 |
* Fix: Add UTF Encoding on file names being backed up and restored
|
views/backup.php
CHANGED
@@ -36,8 +36,8 @@
|
|
36 |
// get retention number set
|
37 |
$number_retained_archives = $this->backup_retained_number();
|
38 |
|
39 |
-
$
|
40 |
-
$
|
41 |
$is_lite_registered = $this->is_lite_registered();
|
42 |
|
43 |
$backup_schedule=$this->backup_schedule();
|
@@ -316,31 +316,52 @@ if (!$backup_folder_exists) {
|
|
316 |
|
317 |
<div id="sidebar">
|
318 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
319 |
<!-- Display opt-in form if the user is unregistered -->
|
320 |
<?php if (!$license_active) : ?>
|
321 |
<?php if (!$is_lite_registered) : ?>
|
322 |
<div class="widget">
|
323 |
-
<h3 class="promo"><?php _e('Register WP BackItUp
|
324 |
<form action="" method="post" id="<?php echo $namespace; ?>-form">
|
325 |
-
<?php wp_nonce_field($namespace . "-register
|
326 |
-
<p><?php _e('Enter your email address to
|
327 |
-
|
328 |
-
|
|
|
|
|
|
|
329 |
<div class="submit"><input type="submit" name="Submit" class="button-secondary" value="<?php _e("Register", $namespace) ?>" /></div>
|
330 |
</form>
|
331 |
</div>
|
332 |
-
<?php
|
333 |
-
<div class="widget">
|
334 |
-
<h3 class="promo"><?php _e('Get a license', $namespace); ?></h3>
|
335 |
-
<p><?php _e('Tired of messing with FTP, MySQL and PHPMyAdmin? Restore your backups from this page in minutes or your money back', $namespace); ?>.</p>
|
336 |
-
<?php echo($this->get_anchor_with_utm('Purchase a license for WP BackItUp','pricing-purchase','get+license','purchase')) ?>
|
337 |
-
</div>
|
338 |
-
<?php endif ?>
|
339 |
<?php endif; ?>
|
340 |
|
|
|
341 |
<!-- Display license key widget -->
|
342 |
<div class="widget">
|
343 |
-
<h3 class="promo"><?php _e('License
|
344 |
<form action="" method="post" id="<?php echo $namespace; ?>-form">
|
345 |
<?php wp_nonce_field($namespace . "-update-options"); ?>
|
346 |
<?php
|
@@ -360,55 +381,76 @@ if (!$backup_folder_exists) {
|
|
360 |
$license_message=' License Status: ' . $license_status;
|
361 |
}
|
362 |
|
363 |
-
if($license_active)
|
364 |
-
echo
|
365 |
-
|
366 |
-
echo
|
|
|
|
|
|
|
|
|
|
|
|
|
367 |
?>
|
368 |
|
369 |
-
<input type="text" name="data[license_key]" id="license_key" value="<?php _e($license_key, $namespace); ?>"
|
370 |
-
<div style="color:<?php _e($fontColor); ?>"><?php _e($license_message, $namespace); ?></div>
|
371 |
-
<div style="color:<?php _e($fontColor); ?>"><?php _e($license_status_message, $namespace); ?></div>
|
372 |
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
|
385 |
-
|
386 |
-
|
387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
|
389 |
-
<?php if ($license_status=='expired'): ?>
|
390 |
-
<div>License expired? <?php echo($this->get_anchor_with_utm('Renew Now ','documentation/faqs/expired-license','license','license+expired'))?> and save 20%.</div>
|
391 |
-
<div>* Offer valid for a limited time!</div>
|
392 |
-
<?php endif; ?>
|
393 |
</form>
|
394 |
</div>
|
|
|
395 |
|
396 |
<!-- Display links widget -->
|
397 |
<div class="widget">
|
398 |
<h3 class="promo"><?php _e('Useful Links', $namespace); ?></h3>
|
399 |
<ul>
|
400 |
<?php if ($license_active) : ?>
|
401 |
-
<li><?php echo($this->get_anchor_with_utm('Your account','
|
402 |
-
|
|
|
|
|
|
|
403 |
<?php endif; ?>
|
404 |
-
|
|
|
405 |
|
406 |
<?php if ($license_active || $is_lite_registered) : ?>
|
407 |
<li><?php echo($this->get_anchor_with_utm('Get support','support' ,'useful+links','get+support'))?></li>
|
408 |
<?php endif; ?>
|
409 |
|
410 |
-
<li><?php echo($this->get_anchor_with_utm('Feature request','
|
411 |
-
|
|
|
|
|
412 |
</ul>
|
413 |
</div>
|
414 |
|
36 |
// get retention number set
|
37 |
$number_retained_archives = $this->backup_retained_number();
|
38 |
|
39 |
+
$license_customer_name = $this->license_customer_name();
|
40 |
+
$license_customer_email = $this->license_customer_email();
|
41 |
$is_lite_registered = $this->is_lite_registered();
|
42 |
|
43 |
$backup_schedule=$this->backup_schedule();
|
316 |
|
317 |
<div id="sidebar">
|
318 |
|
319 |
+
|
320 |
+
<div class="widget">
|
321 |
+
<h3 class="promo"><?php _e('Backups', $namespace); ?> <span style="float: right"><?php _e('Version ' .$version, $namespace); ?></span></h3>
|
322 |
+
<?php if ($this->successful_backup_count()<1) : ?>
|
323 |
+
<p>Welcome to WP BackItUp!<br/> The simplest way to backup your WordPress site.</p>
|
324 |
+
<p>Getting started is easy, just click the backup button on the left side of this page.</p>
|
325 |
+
<?php endif ?>
|
326 |
+
|
327 |
+
<?php if ($this->successful_backup_count()>=1) : ?>
|
328 |
+
<p>Congratulations! You have performed <span style="font-weight:bold;font-size:medium;color: green"><?php _e($this->successful_backup_count(), $namespace); ?></span> successful backups.</p>
|
329 |
+
<p><span style="font-weight:bold;font-size:medium">Tips</span>
|
330 |
+
<br/>1) Backup your site at least once per week
|
331 |
+
<br/>2) Download all your backups and store them somewhere safe
|
332 |
+
<br/>3) Verify your backup files are good by taking a look at what's inside
|
333 |
+
</p>
|
334 |
+
<?php endif ?>
|
335 |
+
|
336 |
+
<?php if (!$license_active && $this->successful_backup_count()>=10) : ?>
|
337 |
+
* Why not <?php echo($this->get_anchor_with_utm('upgrade','pricing-purchase','get+license','purchase'))?> and schedule your backups!
|
338 |
+
<?php endif ?>
|
339 |
+
</div>
|
340 |
+
|
341 |
+
|
342 |
<!-- Display opt-in form if the user is unregistered -->
|
343 |
<?php if (!$license_active) : ?>
|
344 |
<?php if (!$is_lite_registered) : ?>
|
345 |
<div class="widget">
|
346 |
+
<h3 class="promo"><span><?php _e('Register WP BackItUp', $namespace); ?></span></h3>
|
347 |
<form action="" method="post" id="<?php echo $namespace; ?>-form">
|
348 |
+
<?php wp_nonce_field($namespace . "-register"); ?>
|
349 |
+
<p><?php _e('Enter your name and email address below to receive <b>special offers</b> and access to our world class <b>support</b> team. <br />
|
350 |
+
<br />Enter your license key below to activate it on this site.', $namespace); ?></p>
|
351 |
+
<input type="text" name="license_name" id="license_name" placeholder="name" value="<?php echo($license_customer_name) ?>" /><br/>
|
352 |
+
<input type="text" name="license_email" id="license_email" placeholder="email address" value="<?php echo($license_customer_email) ?>" /><br/>
|
353 |
+
<input type="text" name="license_key" id="license_key" placeholder="license key" value="<?php if ($license_key!= 'lite') echo($license_key) ?>" /> <span style="color:red"><?php _e($license_status_message, $namespace); ?></span>
|
354 |
+
<br />* Free plugin customers do not need to enter license key.
|
355 |
<div class="submit"><input type="submit" name="Submit" class="button-secondary" value="<?php _e("Register", $namespace) ?>" /></div>
|
356 |
</form>
|
357 |
</div>
|
358 |
+
<?php endif ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
<?php endif; ?>
|
360 |
|
361 |
+
<?php if ($license_active || $is_lite_registered) : ?>
|
362 |
<!-- Display license key widget -->
|
363 |
<div class="widget">
|
364 |
+
<h3 class="promo"><span><?php _e('License Info', $namespace); ?></span><span style="float: right"></h3></h3>
|
365 |
<form action="" method="post" id="<?php echo $namespace; ?>-form">
|
366 |
<?php wp_nonce_field($namespace . "-update-options"); ?>
|
367 |
<?php
|
381 |
$license_message=' License Status: ' . $license_status;
|
382 |
}
|
383 |
|
384 |
+
if($license_active) {
|
385 |
+
echo('<p>');
|
386 |
+
echo('Name: ' . $license_customer_name);
|
387 |
+
echo('<br/>Email: ' . $license_customer_email);
|
388 |
+
echo('<br/>License Type: ' . $license_type_description);
|
389 |
+
echo('<br/>Expires: ' . $formatted_expired_date);
|
390 |
+
echo('</p>');
|
391 |
+
} else {
|
392 |
+
echo '<p>Enter license key to activate on this site.</p>';
|
393 |
+
}
|
394 |
?>
|
395 |
|
396 |
+
<input type="text" name="data[license_key]" id="license_key" value="<?php _e($license_key, $namespace); ?>" />
|
|
|
|
|
397 |
|
398 |
+
<?php if ($license_status=='valid'): ?>
|
399 |
+
<span style="color:green">License Active</span>
|
400 |
+
<?php endif; ?>
|
401 |
|
402 |
+
<?php if ($license_status=='invalid'): ?>
|
403 |
+
<span style="color:<?php _e($fontColor); ?>"><?php _e($license_status_message, $namespace); ?></span>
|
404 |
+
<?php endif; ?>
|
405 |
|
406 |
+
<?php if ($license_status=='expired'): ?>
|
407 |
+
<span style="color:red">License expired: <?php _e($formatted_expired_date, $namespace); ?></span>
|
408 |
+
<?php endif; ?>
|
409 |
|
410 |
+
<?php if ($license_active) : ?>
|
411 |
+
<div class="submit"><input type="submit" name="Submit" class="button-secondary" value="<?php _e("Update", $namespace) ?>" /></div>
|
412 |
+
<?php endif; ?>
|
413 |
+
|
414 |
+
<?php if (!$license_active) : ?>
|
415 |
+
<p class="submit"><input type="submit" name="Submit" class="button-secondary" value="<?php _e("Activate", $namespace) ?>" /></p>
|
416 |
+
<?php endif; ?>
|
417 |
+
|
418 |
+
<?php if ($license_status=='invalid' || $license_status==''): ?>
|
419 |
+
<p>Purchase a <?php echo($this->get_anchor_with_utm('no-risk','pricing-purchase','license','no+risk'))?> license using the purchase link above.</p>
|
420 |
+
<?php endif; ?>
|
421 |
+
|
422 |
+
<?php if ($license_status=='expired'): ?>
|
423 |
+
<div><?php echo(
|
424 |
+
'<a target="_blank" href="' .WPBACKITUP__SECURESITE_URL .'/checkout?edd_license_key='.$license_key .'&download_id=679&nocache=true&utm_medium=plugin&utm_source=wp-backitup&utm_campaign=premium&utm_content=license&utm_term=license+expired">Renew</a>');
|
425 |
+
?> your license now for another year of <strong>product updates</strong> and <strong>priority support.</strong></div>
|
426 |
+
<?php endif; ?>
|
427 |
|
|
|
|
|
|
|
|
|
428 |
</form>
|
429 |
</div>
|
430 |
+
<?php endif; ?>
|
431 |
|
432 |
<!-- Display links widget -->
|
433 |
<div class="widget">
|
434 |
<h3 class="promo"><?php _e('Useful Links', $namespace); ?></h3>
|
435 |
<ul>
|
436 |
<?php if ($license_active) : ?>
|
437 |
+
<li><?php echo($this->get_anchor_with_utm('Your account','account','useful+links','your+account'))?></li>
|
438 |
+
<?php endif; ?>
|
439 |
+
|
440 |
+
<?php if (!$license_active) : ?>
|
441 |
+
<li><?php echo($this->get_anchor_with_utm('Purchase a license','pricing-purchase','useful+links','upgrade+license'))?></li>
|
442 |
<?php endif; ?>
|
443 |
+
|
444 |
+
<li><?php echo($this->get_anchor_with_utm('Documentation','documentation/faqs/wp-backitup-logging','useful+links','help'))?></li>
|
445 |
|
446 |
<?php if ($license_active || $is_lite_registered) : ?>
|
447 |
<li><?php echo($this->get_anchor_with_utm('Get support','support' ,'useful+links','get+support'))?></li>
|
448 |
<?php endif; ?>
|
449 |
|
450 |
+
<li><?php echo($this->get_anchor_with_utm('Feature request','contact' ,'useful+links','feature+request'))?></li>
|
451 |
+
|
452 |
+
<li><?php echo($this->get_anchor_with_utm('Contact','contact' ,'useful+links','contact'))?></li>
|
453 |
+
|
454 |
</ul>
|
455 |
</div>
|
456 |
|
wp-backitup.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
Plugin Name: WP Backitup
|
14 |
Plugin URI: http://www.wpbackitup.com
|
15 |
Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
|
16 |
-
Version: 1.10.
|
17 |
Author: Chris Simmons
|
18 |
Author URI: http://www.wpbackitup.com
|
19 |
License: GPL3
|
@@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
35 |
*/
|
36 |
|
37 |
define( 'WPBACKITUP__NAMESPACE', 'wp-backitup' );
|
38 |
-
define( 'WPBACKITUP__VERSION', '1.10.
|
39 |
define( 'WPBACKITUP__DEBUG', false );
|
40 |
define( 'WPBACKITUP__MINIMUM_WP_VERSION', '3.0' );
|
41 |
define( 'WPBACKITUP__ITEM_NAME', 'WP Backitup' );
|
13 |
Plugin Name: WP Backitup
|
14 |
Plugin URI: http://www.wpbackitup.com
|
15 |
Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
|
16 |
+
Version: 1.10.4
|
17 |
Author: Chris Simmons
|
18 |
Author URI: http://www.wpbackitup.com
|
19 |
License: GPL3
|
35 |
*/
|
36 |
|
37 |
define( 'WPBACKITUP__NAMESPACE', 'wp-backitup' );
|
38 |
+
define( 'WPBACKITUP__VERSION', '1.10.4');
|
39 |
define( 'WPBACKITUP__DEBUG', false );
|
40 |
define( 'WPBACKITUP__MINIMUM_WP_VERSION', '3.0' );
|
41 |
define( 'WPBACKITUP__ITEM_NAME', 'WP Backitup' );
|