InfiniteWP Client - Version 1.0.2

Version Description

  • Bugs fixed
Download this release

Release Info

Developer infinitewp
Plugin Icon 128x128 InfiniteWP Client
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.0 to 1.0.2

Files changed (6) hide show
  1. backup.class.php +6 -638
  2. core.class.php +17 -11
  3. init.php +11 -240
  4. installer.class.php +1 -15
  5. readme.txt +17 -9
  6. stats.class.php +1 -9
backup.class.php CHANGED
@@ -82,14 +82,6 @@ class IWP_MMB_Backup extends IWP_MMB_Core
82
  'db_dump' => 1,
83
  'db_zip' => 2,
84
  'files_zip' => 3,
85
- /*
86
- //IWP Remove starts here
87
- 's3' => 4,
88
- 'dropbox' => 5,
89
- 'ftp' => 6,
90
- 'email' => 7,
91
- //IWP Remove ends here
92
- */
93
  'finished' => 100
94
  );
95
  $this->tasks = get_option('iwp_client_backup_tasks');
@@ -121,20 +113,8 @@ class IWP_MMB_Backup extends IWP_MMB_Core
121
  'removed' => true
122
  );
123
  } else {
124
- /*
125
- //IWP Remove starts here
126
- if (is_array($params['account_info'])) { //only if sends from IWP Admin Panel first time(secure data)
127
- $args['account_info'] = $account_info;
128
- }
129
- //IWP Remove ends here
130
- */
131
  $before[$task_name]['task_args'] = $args;
132
- /*
133
- //IWP Remove starts here
134
- if (strlen($args['schedule']))
135
- $before[$task_name]['task_args']['next'] = $this->schedule_next($args['type'], $args['schedule']);
136
- //IWP Remove ends here
137
- */
138
  $return = $before[$task_name];
139
  }
140
 
@@ -230,44 +210,6 @@ if (strlen($args['schedule']))
230
 
231
  }
232
 
233
- /*
234
- //IWP Remove starts here
235
- function task_now($task_name){
236
-
237
- $settings = $this->tasks;
238
- if(!array_key_exists($task_name,$settings)){
239
- return array('error' => $task_name." does not exist.");
240
- } else {
241
- $setting = $settings[$task_name];
242
- }
243
-
244
- $this->set_backup_task(array(
245
- 'task_name' => $task_name,
246
- 'args' => $settings[$task_name]['task_args'],
247
- 'time' => time()
248
- ));
249
-
250
- //Run backup
251
- $result = $this->backup($setting['task_args'], $task_name);
252
-
253
- //Check for error
254
- if (is_array($result) && array_key_exists('error', $result)) {
255
- $this->set_backup_task(array(
256
- 'task_name' => $task_name,
257
- 'args' => $settings[$task_name]['task_args'],
258
- 'error' => $result['error']
259
- ));
260
- return $result;
261
- } else {
262
- return $this->get_backup_stats();
263
- }
264
-
265
- }
266
- //IWP Remove ends here
267
- */
268
-
269
-
270
-
271
  /*
272
  * If Task Name not set then it's manual backup
273
  * Backup args:
@@ -404,27 +346,7 @@ function task_now($task_name){
404
  'file_url' => $backup_url
405
  );
406
  }
407
-
408
- /*
409
- //IWP Remove starts here
410
- if (isset($backup_settings[$task_name]['task_args']['account_info']['iwp_ftp'])) {
411
- $paths['ftp'] = basename($backup_url);
412
- }
413
-
414
- if (isset($backup_settings[$task_name]['task_args']['account_info']['iwp_amazon_s3'])) {
415
- $paths['amazons3'] = basename($backup_url);
416
- }
417
-
418
- if (isset($backup_settings[$task_name]['task_args']['account_info']['iwp_dropbox'])) {
419
- $paths['dropbox'] = basename($backup_url);
420
- }
421
-
422
- if (isset($backup_settings[$task_name]['task_args']['account_info']['iwp_email'])) {
423
- $paths['email'] = basename($backup_url);
424
- }
425
- //IWP Remove ends here
426
- */
427
-
428
  $temp = $backup_settings[$task_name]['task_results'];
429
  $temp = array_values($temp);
430
  $paths['time'] = time();
@@ -443,71 +365,9 @@ if (isset($backup_settings[$task_name]['task_args']['account_info']['iwp_ftp']))
443
  //update_option('iwp_client_backup_tasks', $backup_settings);
444
  }
445
 
446
-
447
  //Additional: Email, ftp, amazon_s3, dropbox...
448
 
449
  if ($task_name != 'Backup Now') {
450
- /*
451
- //IWP Remove starts here
452
- if (isset($account_info['iwp_ftp']) && !empty($account_info['iwp_ftp'])) {
453
- $this->update_status($task_name, $this->statuses['ftp']);
454
- $account_info['iwp_ftp']['backup_file'] = $backup_file;
455
- $ftp_result = $this->ftp_backup($account_info['iwp_ftp']);
456
-
457
- if ($ftp_result !== true && $del_host_file) {
458
- @unlink($backup_file);
459
- }
460
-
461
- if (is_array($ftp_result) && isset($ftp_result['error'])) {
462
- return $ftp_result;
463
- }
464
- $this->wpdb_reconnect();
465
- $this->update_status($task_name, $this->statuses['ftp'], true);
466
- }
467
-
468
- if (isset($account_info['iwp_amazon_s3']) && !empty($account_info['iwp_amazon_s3'])) {
469
- $this->update_status($task_name, $this->statuses['s3']);
470
- $account_info['iwp_amazon_s3']['backup_file'] = $backup_file;
471
- $amazons3_result = $this->amazons3_backup($account_info['iwp_amazon_s3']);
472
- if ($amazons3_result !== true && $del_host_file) {
473
- @unlink($backup_file);
474
- }
475
- if (is_array($amazons3_result) && isset($amazons3_result['error'])) {
476
- return $amazons3_result;
477
- }
478
- $this->wpdb_reconnect();
479
- $this->update_status($task_name, $this->statuses['s3'], true);
480
- }
481
-
482
- if (isset($account_info['iwp_dropbox']) && !empty($account_info['iwp_dropbox'])) {
483
- $this->update_status($task_name, $this->statuses['dropbox']);
484
- $account_info['iwp_dropbox']['backup_file'] = $backup_file;
485
- $dropbox_result = $this->dropbox_backup($account_info['iwp_dropbox']);
486
- if ($dropbox_result !== true && $del_host_file) {
487
- @unlink($backup_file);
488
- }
489
-
490
- if (is_array($dropbox_result) && isset($dropbox_result['error'])) {
491
- return $dropbox_result;
492
- }
493
- $this->wpdb_reconnect();
494
- $this->update_status($task_name, $this->statuses['dropbox'], true);
495
- }
496
-
497
- if (isset($account_info['iwp_email']) && !empty($account_info['iwp_email'])) {
498
- $this->update_status($task_name, $this->statuses['email']);
499
- $account_info['iwp_email']['task_name'] = $task_name;
500
- $account_info['iwp_email']['file_path'] = $backup_file;
501
-
502
- $email_result = $this->email_backup($account_info['iwp_email']);
503
- if (is_array($email_result) && isset($email_result['error'])) {
504
- return $email_result;
505
- }
506
- $this->update_status($task_name, $this->statuses['email'], true);
507
- }
508
- //IWP Remove ends here
509
- */
510
-
511
  if ($del_host_file) {
512
  @unlink($backup_file);
513
  }
@@ -859,31 +719,7 @@ if (isset($account_info['iwp_ftp']) && !empty($account_info['iwp_ftp'])) {
859
  if (isset($task['task_results'][$result_id]['server'])) {
860
  $backup_file = $task['task_results'][$result_id]['server']['file_path'];
861
  $unlink_file = false; //Don't delete file if stored on server
862
- } /*
863
- //IWP Remove starts here
864
- elseif (isset($task['task_results'][$result_id]['ftp'])) {
865
- $ftp_file = $task['task_results'][$result_id]['ftp'];
866
- $args = $task['task_args']['account_info']['iwp_ftp'];
867
- $args['backup_file'] = $ftp_file;
868
- $backup_file = $this->get_ftp_backup($args);
869
- if ($backup_file == false) {
870
- return array(
871
- 'error' => 'Failed to download file from FTP.'
872
- );
873
- }
874
- } elseif (isset($task['task_results'][$result_id]['amazons3'])) {
875
- $amazons3_file = $task['task_results'][$result_id]['amazons3'];
876
- $args = $task['task_args']['account_info']['iwp_amazon_s3'];
877
- $args['backup_file'] = $ftp_file;
878
- $backup_file = $this->get_amazons3_backup($args);
879
- if ($backup_file == false) {
880
- return array(
881
- 'error' => 'Failed to download file from Amazon S3.'
882
- );
883
- }
884
- }
885
- //IWP Remove ends here
886
- */
887
 
888
  $what = $tasks[$task_name]['task_args']['what'];
889
  }
@@ -1343,351 +1179,7 @@ elseif (isset($task['task_results'][$result_id]['ftp'])) {
1343
 
1344
  return $reqs;
1345
  }
1346
-
1347
- /*
1348
- //IWP Remove starts here
1349
- function email_backup($args)
1350
- {
1351
- $email = $args['email'];
1352
-
1353
- if (!is_email($email)) {
1354
- return array(
1355
- 'error' => 'Your email (' . $email . ') is not correct'
1356
- );
1357
- }
1358
- $backup_file = $args['file_path'];
1359
- $task_name = isset($args['task_name']) ? $args['task_name'] : '';
1360
- if (file_exists($backup_file) && $email) {
1361
- $attachments = array(
1362
- $backup_file
1363
- );
1364
- $headers = 'From: InfiniteWP <no-reply@infinitewp.com>' . "\r\n";
1365
- $subject = "InfiniteWP - " . $task_name . " - " . $this->site_name;
1366
- ob_start();
1367
- $result = wp_mail($email, $subject, $subject, $headers, $attachments);
1368
- ob_end_clean();
1369
-
1370
- }
1371
-
1372
- if (!$result) {
1373
- return array(
1374
- 'error' => 'Email not sent. Maybe your backup is too big for email or email server is not available on your website.'
1375
- );
1376
- }
1377
- return true;
1378
-
1379
- }
1380
-
1381
- function ftp_backup($args)
1382
- {
1383
- extract($args);
1384
- //Args: $ftp_username, $ftp_password, $ftp_hostname, $backup_file, $ftp_remote_folder, $ftp_site_folder
1385
- $port = $ftp_port ? $ftp_port : 21; //default port is 21
1386
- if ($ftp_ssl) {
1387
- if (function_exists('ftp_ssl_connect')) {
1388
- $conn_id = ftp_ssl_connect($ftp_hostname,$port);
1389
- } else {
1390
- return array(
1391
- 'error' => 'Your server doesn\'t support SFTP',
1392
- 'partial' => 1
1393
- );
1394
- }
1395
- } else {
1396
- if (function_exists('ftp_connect')) {
1397
- $conn_id = ftp_connect($ftp_hostname,$port);
1398
- if ($conn_id === false) {
1399
- return array(
1400
- 'error' => 'Failed to connect to ' . $ftp_hostname,
1401
- 'partial' => 1
1402
- );
1403
- }
1404
- } else {
1405
- return array(
1406
- 'error' => 'Your server doesn\'t support FTP',
1407
- 'partial' => 1
1408
- );
1409
- }
1410
- }
1411
- $login = @ftp_login($conn_id, $ftp_username, $ftp_password);
1412
- if ($login === false) {
1413
- return array(
1414
- 'error' => 'FTP login failed for ' . $ftp_username . ', ' . $ftp_password,
1415
- 'partial' => 1
1416
- );
1417
- }
1418
-
1419
- if($ftp_passive){
1420
- @ftp_pasv($conn_id,true);
1421
- }
1422
-
1423
- @ftp_mkdir($conn_id, $ftp_remote_folder);
1424
- if ($ftp_site_folder) {
1425
- $ftp_remote_folder .= '/' . $this->site_name;
1426
- }
1427
- @ftp_mkdir($conn_id, $ftp_remote_folder);
1428
-
1429
- $upload = @ftp_put($conn_id, $ftp_remote_folder . '/' . basename($backup_file), $backup_file, FTP_BINARY);
1430
-
1431
- if ($upload === false) { //Try ascii
1432
- $upload = @ftp_put($conn_id, $ftp_remote_folder . '/' . basename($backup_file), $backup_file, FTP_ASCII);
1433
- }
1434
- ftp_close($conn_id);
1435
-
1436
- if ($upload === false) {
1437
- return array(
1438
- 'error' => 'Failed to upload file to FTP. Please check your specified path.',
1439
- 'partial' => 1
1440
- );
1441
- }
1442
-
1443
- return true;
1444
- }
1445
-
1446
- function remove_ftp_backup($args)
1447
- {
1448
- extract($args);
1449
- //Args: $ftp_username, $ftp_password, $ftp_hostname, $backup_file, $ftp_remote_folder
1450
- $port = $ftp_port ? $ftp_port : 21; //default port is 21
1451
- if ($ftp_ssl && function_exists('ftp_ssl_connect')) {
1452
- $conn_id = ftp_ssl_connect($ftp_hostname,$port);
1453
- } else if (function_exists('ftp_connect')) {
1454
- $conn_id = ftp_connect($ftp_hostname,$port);
1455
- }
1456
-
1457
- if ($conn_id) {
1458
- $login = @ftp_login($conn_id, $ftp_username, $ftp_password);
1459
- if ($ftp_site_folder)
1460
- $ftp_remote_folder .= '/' . $this->site_name;
1461
-
1462
- if($ftp_passive){
1463
- @ftp_pasv($conn_id,true);
1464
- }
1465
-
1466
- $delete = ftp_delete($conn_id, $ftp_remote_folder . '/' . $backup_file);
1467
-
1468
- ftp_close($conn_id);
1469
- }
1470
-
1471
- }
1472
-
1473
- function get_ftp_backup($args)
1474
- {
1475
- extract($args);
1476
- //Args: $ftp_username, $ftp_password, $ftp_hostname, $backup_file, $ftp_remote_folder
1477
- $port = $ftp_port ? $ftp_port : 21; //default port is 21
1478
- if ($ftp_ssl && function_exists('ftp_ssl_connect')) {
1479
- $conn_id = ftp_ssl_connect($ftp_hostname,$port);
1480
-
1481
- } else if (function_exists('ftp_connect')) {
1482
- $conn_id = ftp_connect($ftp_hostname,$port);
1483
- if ($conn_id === false) {
1484
- return false;
1485
- }
1486
- }
1487
- $login = @ftp_login($conn_id, $ftp_username, $ftp_password);
1488
- if ($login === false) {
1489
- return false;
1490
- } else {
1491
- }
1492
-
1493
- if ($ftp_site_folder)
1494
- $ftp_remote_folder .= '/' . $this->site_name;
1495
-
1496
- if($ftp_passive){
1497
- @ftp_pasv($conn_id,true);
1498
- }
1499
-
1500
- $temp = ABSPATH . 'iwp_temp_backup.zip';
1501
- $get = ftp_get($conn_id, $temp, $ftp_remote_folder . '/' . $backup_file, FTP_BINARY);
1502
- if ($get === false) {
1503
- return false;
1504
- } else {
1505
- }
1506
- ftp_close($conn_id);
1507
-
1508
- return $temp;
1509
- }
1510
-
1511
- function dropbox_backup($args)
1512
- {
1513
- require_once('lib/dropbox.php');
1514
- extract($args);
1515
-
1516
- //$email, $password, $backup_file, $destination, $dropbox_site_folder
1517
-
1518
- $size = ceil(filesize($backup_file) / 1024);
1519
- if ($size > 300000) {
1520
- return array(
1521
- 'error' => 'Cannot upload file to Dropbox. Dropbox has upload limit of 300Mb per file.',
1522
- 'partial' => 1
1523
- );
1524
- }
1525
-
1526
- if ($dropbox_site_folder == true)
1527
- $dropbox_destination .= '/' . $this->site_name;
1528
-
1529
- try {
1530
- $uploader = new DropboxUploader($dropbox_username, $dropbox_password);
1531
- $uploader->upload($backup_file, $dropbox_destination);
1532
- }
1533
- catch (Exception $e) {
1534
- return array(
1535
- 'error' => $e->getMessage(),
1536
- 'partial' => 1
1537
- );
1538
- }
1539
-
1540
- return true;
1541
-
1542
- }
1543
-
1544
- function amazons3_backup($args)
1545
- {
1546
- if ($this->iwp_mmb_function_exists('curl_init')) {
1547
- require_once('lib/s3.php');
1548
- extract($args);
1549
-
1550
- if ($as3_site_folder == true)
1551
- $as3_directory .= '/' . $this->site_name;
1552
-
1553
- $endpoint = isset($as3_bucket_region) ? $as3_bucket_region : 's3.amazonaws.com';
1554
-
1555
- $s3 = new S3(trim($as3_access_key), trim(str_replace(' ', '+', $as3_secure_key)), false, $endpoint);
1556
-
1557
- $s3->putBucket($as3_bucket, S3::ACL_PUBLIC_READ);
1558
-
1559
- if ($s3->putObjectFile($backup_file, $as3_bucket, $as3_directory . '/' . basename($backup_file), S3::ACL_PRIVATE)) {
1560
- return true;
1561
- } else {
1562
- return array(
1563
- 'error' => 'Failed to upload to Amazon S3. Please check your details and set upload/delete permissions on your bucket.',
1564
- 'partial' => 1
1565
- );
1566
- }
1567
- } else {
1568
- return array(
1569
- 'error' => 'You cannot use Amazon S3 on your server. Please enable curl first.',
1570
- 'partial' => 1
1571
- );
1572
- }
1573
- }
1574
-
1575
- function remove_amazons3_backup($args)
1576
- {
1577
- require_once('lib/s3.php');
1578
- extract($args);
1579
- if ($as3_site_folder == true)
1580
- $as3_directory .= '/' . $this->site_name;
1581
- $endpoint = isset($as3_bucket_region) ? $as3_bucket_region : 's3.amazonaws.com';
1582
- $s3 = new S3($as3_access_key, str_replace(' ', '+', $as3_secure_key), false, $endpoint);
1583
- $s3->deleteObject($as3_bucket, $as3_directory . '/' . $backup_file);
1584
- }
1585
-
1586
- function get_amazons3_backup($args)
1587
- {
1588
- require_once('lib/s3.php');
1589
- extract($args);
1590
- $endpoint = isset($as3_bucket_region) ? $as3_bucket_region : 's3.amazonaws.com';
1591
- $s3 = new S3($as3_access_key, str_replace(' ', '+', $as3_secure_key), false, $endpoint);
1592
- if ($as3_site_folder == true)
1593
- $as3_directory .= '/' . $this->site_name;
1594
-
1595
- $temp = ABSPATH . 'iwp_temp_backup.zip';
1596
- $s3->getObject($as3_bucket, $as3_directory . '/' . $backup_file, $temp);
1597
-
1598
- return $temp;
1599
- }
1600
-
1601
- function schedule_next($type, $schedule)
1602
- {
1603
- $schedule = explode("|", $schedule);
1604
- if (empty($schedule))
1605
- return false;
1606
- switch ($type) {
1607
-
1608
- case 'daily':
1609
-
1610
- if ($schedule[1]) {
1611
- $delay_time = $schedule[1] * 60;
1612
- }
1613
-
1614
- $current_hour = date("H");
1615
- $schedule_hour = $schedule[0];
1616
- if ($current_hour >= $schedule_hour){
1617
- $time = mktime($schedule_hour, 0, 0, date("m"), date("d") + 1, date("Y"));
1618
- //$time ='0001#'.$current_hour.'|'.$schedule_hour;
1619
- }
1620
- else{
1621
- $time = mktime($schedule_hour, 0, 0, date("m"), date("d"), date("Y"));
1622
- //$time ='0000#'.$current_hour.'|'.$schedule_hour;
1623
- }
1624
- $time = time() + 30;
1625
- break;
1626
-
1627
-
1628
- case 'weekly':
1629
- if ($schedule[2]) {
1630
- $delay_time = $schedule[2] * 60;
1631
- }
1632
- $current_weekday = date('w');
1633
- $schedule_weekday = $schedule[1];
1634
- $current_hour = date("H");
1635
- $schedule_hour = $schedule[0];
1636
-
1637
- if ($current_weekday > $schedule_weekday)
1638
- $weekday_offset = 7 - ($week_day - $task_schedule[1]);
1639
- else
1640
- $weekday_offset = $schedule_weekday - $current_weekday;
1641
-
1642
-
1643
- if (!$weekday_offset) { //today is scheduled weekday
1644
- if ($current_hour >= $schedule_hour)
1645
- $time = mktime($schedule_hour, 0, 0, date("m"), date("d") + 7, date("Y"));
1646
- else
1647
- $time = mktime($schedule_hour, 0, 0, date("m"), date("d"), date("Y"));
1648
- } else {
1649
- $time = mktime($schedule_hour, 0, 0, date("m"), date("d") + $weekday_offset, date("Y"));
1650
- }
1651
-
1652
- break;
1653
-
1654
- case 'monthly':
1655
- if ($schedule[2]) {
1656
- $delay_time = $schedule[2] * 60;
1657
- }
1658
- $current_monthday = date('j');
1659
- $schedule_monthday = $schedule[1];
1660
- $current_hour = date("H");
1661
- $schedule_hour = $schedule[0];
1662
-
1663
- if ($current_monthday > $schedule_monthday) {
1664
- $time = mktime($schedule_hour, 0, 0, date("m") + 1, $schedule_monthday, date("Y"));
1665
- } else if ($current_monthday < $schedule_monthday) {
1666
- $time = mktime($schedule_hour, 0, 0, date("m"), $schedule_monthday, date("Y"));
1667
- } else if ($current_monthday == $schedule_monthday) {
1668
- if ($current_hour >= $schedule_hour)
1669
- $time = mktime($schedule_hour, 0, 0, date("m") + 1, $schedule_monthday, date("Y"));
1670
- else
1671
- $time = mktime($schedule_hour, 0, 0, date("m"), $schedule_monthday, date("Y"));
1672
- break;
1673
- }
1674
-
1675
- break;
1676
- default:
1677
- break;
1678
- }
1679
-
1680
- if ($delay_time) {
1681
- $time += $delay_time;
1682
- }
1683
-
1684
-
1685
- return $time;
1686
 
1687
- }
1688
- //IWP Remove ends here
1689
- */
1690
-
1691
  //Parse task arguments for info on IWP Admin Panel
1692
  function get_backup_stats()
1693
  {
@@ -1711,23 +1203,7 @@ function email_backup($args)
1711
  }
1712
  return $stats;
1713
  }
1714
-
1715
- /*
1716
- //IWP Remove starts here
1717
- function get_next_schedules()
1718
- {
1719
- $stats = array();
1720
- $tasks = $this->tasks;
1721
- if (is_array($tasks) && !empty($tasks)) {
1722
- foreach ($tasks as $task_name => $info) {
1723
- $stats[$task_name] = isset($info['task_args']['next']) ? $info['task_args']['next'] : array();
1724
- }
1725
- }
1726
- return $stats;
1727
- }
1728
- //IWP Remove ends here
1729
- */
1730
-
1731
  function remove_old_backups($task_name)
1732
  {
1733
  //Check for previous failed backups first
@@ -1750,30 +1226,7 @@ function get_next_schedules()
1750
  if (isset($backups[$task_name]['task_results'][$i]['server'])) {
1751
  @unlink($backups[$task_name]['task_results'][$i]['server']['file_path']);
1752
  }
1753
-
1754
- /*
1755
- //IWP Remove starts here
1756
- //Remove from ftp
1757
- if (isset($backups[$task_name]['task_results'][$i]['ftp'])) {
1758
- $ftp_file = $backups[$task_name]['task_results'][$i]['ftp'];
1759
- $args = $backups[$task_name]['task_args']['account_info']['iwp_ftp'];
1760
- $args['backup_file'] = $ftp_file;
1761
- $this->remove_ftp_backup($args);
1762
- }
1763
-
1764
- if (isset($backups[$task_name]['task_results'][$i]['amazons3'])) {
1765
- $amazons3_file = $backups[$task_name]['task_results'][$i]['amazons3'];
1766
- $args = $backups[$task_name]['task_args']['account_info']['iwp_amazon_s3'];
1767
- $args['backup_file'] = $amazons3_file;
1768
- $this->remove_amazons3_backup($args);
1769
- }
1770
-
1771
- if (isset($backups[$task_name]['task_results'][$i]['dropbox'])) {
1772
- //To do: dropbox remove
1773
- }
1774
- //IWP Remove ends here
1775
- */
1776
-
1777
  //Remove database backup info
1778
  unset($backups[$task_name]['task_results'][$i]);
1779
 
@@ -1807,30 +1260,7 @@ function get_next_schedules()
1807
 
1808
  if (isset($backup['server'])) {
1809
  @unlink($backup['server']['file_path']);
1810
- }
1811
-
1812
- /*
1813
- //IWP Remove starts here
1814
- //Remove from ftp
1815
- if (isset($backup['ftp'])) {
1816
- $ftp_file = $backup['ftp'];
1817
- $args = $tasks[$task_name]['task_args']['account_info']['iwp_ftp'];
1818
- $args['backup_file'] = $ftp_file;
1819
- $this->remove_ftp_backup($args);
1820
- }
1821
-
1822
- if (isset($backup['amazons3'])) {
1823
- $amazons3_file = $backup['amazons3'];
1824
- $args = $tasks[$task_name]['task_args']['account_info']['iwp_amazon_s3'];
1825
- $args['backup_file'] = $amazons3_file;
1826
- $this->remove_amazons3_backup($args);
1827
- }
1828
-
1829
- if (isset($backup['dropbox'])) {
1830
- }
1831
- //IWP Remove ends here
1832
- */
1833
-
1834
  unset($backups[$result_id]);
1835
 
1836
  if (count($backups)) {
@@ -1910,68 +1340,6 @@ function get_next_schedules()
1910
 
1911
 
1912
  /*
1913
- //IWP Remove starts here
1914
- function remote_backup_now($args)
1915
- {
1916
- if (!empty($args))
1917
- extract($args);
1918
-
1919
- $tasks = $this->tasks;
1920
- $task = $tasks['Backup Now'];
1921
-
1922
- if (!empty($task)) {
1923
- extract($task['task_args']);
1924
- }
1925
-
1926
- $results = $task['task_results'];
1927
-
1928
- if (is_array($results) && count($results)) {
1929
- $backup_file = $results[count($results) - 1]['server']['file_path'];
1930
- }
1931
-
1932
- if ($backup_file && file_exists($backup_file)) {
1933
- //FTP, Amazon S3 or Dropbox
1934
- if (isset($account_info['iwp_ftp']) && !empty($account_info['iwp_ftp'])) {
1935
- $account_info['iwp_ftp']['backup_file'] = $backup_file;
1936
- $return = $this->ftp_backup($account_info['iwp_ftp']);
1937
- }
1938
-
1939
- if (isset($account_info['iwp_amazon_s3']) && !empty($account_info['iwp_amazon_s3'])) {
1940
- $account_info['iwp_amazon_s3']['backup_file'] = $backup_file;
1941
- $return = $this->amazons3_backup($account_info['iwp_amazon_s3']);
1942
- }
1943
-
1944
- if (isset($account_info['iwp_dropbox']) && !empty($account_info['iwp_dropbox'])) {
1945
- $account_info['iwp_dropbox']['backup_file'] = $backup_file;
1946
- $return = $this->dropbox_backup($account_info['iwp_dropbox']);
1947
- }
1948
-
1949
- if (isset($account_info['iwp_email']) && !empty($account_info['iwp_email'])) {
1950
- $account_info['iwp_email']['file_path'] = $backup_file;
1951
- $account_info['iwp_email']['task_name'] = 'Backup Now';
1952
- $return = $this->email_backup($account_info['iwp_email']);
1953
- }
1954
-
1955
-
1956
- if ($return == true && $del_host_file) {
1957
- @unlink($backup_file);
1958
- unset($tasks['Backup Now']['task_results'][count($results) - 1]['server']);
1959
- $this->update_tasks($tasks);
1960
- //update_option('iwp_client_backup_tasks', $tasks);
1961
- }
1962
-
1963
-
1964
-
1965
- } else {
1966
- $return = array(
1967
- 'error' => 'Backup file not found on your server. Please try again.'
1968
- );
1969
- }
1970
-
1971
- return $return;
1972
-
1973
- }
1974
- //IWP Remove ends here
1975
  */
1976
 
1977
  function validate_task($args, $url)
82
  'db_dump' => 1,
83
  'db_zip' => 2,
84
  'files_zip' => 3,
 
 
 
 
 
 
 
 
85
  'finished' => 100
86
  );
87
  $this->tasks = get_option('iwp_client_backup_tasks');
113
  'removed' => true
114
  );
115
  } else {
116
+
 
 
 
 
 
 
117
  $before[$task_name]['task_args'] = $args;
 
 
 
 
 
 
118
  $return = $before[$task_name];
119
  }
120
 
210
 
211
  }
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  /*
214
  * If Task Name not set then it's manual backup
215
  * Backup args:
346
  'file_url' => $backup_url
347
  );
348
  }
349
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
  $temp = $backup_settings[$task_name]['task_results'];
351
  $temp = array_values($temp);
352
  $paths['time'] = time();
365
  //update_option('iwp_client_backup_tasks', $backup_settings);
366
  }
367
 
 
368
  //Additional: Email, ftp, amazon_s3, dropbox...
369
 
370
  if ($task_name != 'Backup Now') {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  if ($del_host_file) {
372
  @unlink($backup_file);
373
  }
719
  if (isset($task['task_results'][$result_id]['server'])) {
720
  $backup_file = $task['task_results'][$result_id]['server']['file_path'];
721
  $unlink_file = false; //Don't delete file if stored on server
722
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
723
 
724
  $what = $tasks[$task_name]['task_args']['what'];
725
  }
1179
 
1180
  return $reqs;
1181
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1182
 
 
 
 
 
1183
  //Parse task arguments for info on IWP Admin Panel
1184
  function get_backup_stats()
1185
  {
1203
  }
1204
  return $stats;
1205
  }
1206
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1207
  function remove_old_backups($task_name)
1208
  {
1209
  //Check for previous failed backups first
1226
  if (isset($backups[$task_name]['task_results'][$i]['server'])) {
1227
  @unlink($backups[$task_name]['task_results'][$i]['server']['file_path']);
1228
  }
1229
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1230
  //Remove database backup info
1231
  unset($backups[$task_name]['task_results'][$i]);
1232
 
1260
 
1261
  if (isset($backup['server'])) {
1262
  @unlink($backup['server']['file_path']);
1263
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1264
  unset($backups[$result_id]);
1265
 
1266
  if (count($backups)) {
1340
 
1341
 
1342
  /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1343
  */
1344
 
1345
  function validate_task($args, $url)
core.class.php CHANGED
@@ -82,8 +82,8 @@ class IWP_MMB_Core extends IWP_MMB_Helper
82
  if( is_network_admin() && $this->network_admin_install == '1'){
83
  add_action('network_admin_notices', array( &$this, 'network_admin_notice' ));
84
  } else if( $this->network_admin_install != '1' ){
85
- $parent_key = $this->get_parent_blog_option('iwp_client_public_key');
86
- if(empty($parent_key))
87
  add_action('admin_notices', array( &$this, 'admin_notice' ));
88
  }
89
  } else {
@@ -193,9 +193,8 @@ class IWP_MMB_Core extends IWP_MMB_Helper
193
  */
194
  function network_admin_notice()
195
  {
196
- echo '<div class="error" style="text-align: center;"><p style="color: red; font-size: 14px; font-weight: bold;">Attention !</p><p>
197
- Please add this site and your network blogs, with your network adminstrator username, to your <a target="_blank" href="http://infinitewp.com/wp-admin">InfiniteWP.com</a> account now to remove this notice or "Network Deactivate" the Client plugin to avoid <a target="_blank" href="http://infinitewp.com/user-guide/security">security issues</a>.
198
- </p></div>';
199
  }
200
 
201
 
@@ -206,14 +205,21 @@ class IWP_MMB_Core extends IWP_MMB_Helper
206
  function admin_notice()
207
  {
208
  /* IWP */
209
- /* echo '<div class="error" style="text-align: center;"><p style="color: red; font-size: 14px; font-weight: bold;">Attention !</p><p>
210
- Please add this site now to your <a target="_blank" href="http://infinitewp.com/wp-admin">InfiniteWP.com</a> account. Or deactivate the Client plugin to avoid <a target="_blank" href="http://infinitewp.com/user-guide/security">security issues</a>.
211
- </p></div>';*/
212
- $current_user = wp_get_current_user();
 
 
 
 
 
 
 
213
  echo '<div class="updated" style="text-align: center;"><p style="color: green; font-size: 14px; font-weight: bold;">Add this site to IWP Admin panel</p><p>
214
  <table border="0" align="center">
215
  <tr><td align="right">WEBSITE URL:</td><td align="left"><strong>'.get_option('home').'/</strong></td></tr>
216
- <tr><td align="right">ADMIN USERNAME:</td><td align="left"><strong>'.$current_user->data->user_login.'</strong> (or any admin id)</td></tr>
217
  <tr><td align="right">ACTIVATION KEY:</td><td align="left"><strong>'.get_option('iwp_client_activate_key').'</strong></td></tr>
218
  </table>
219
  </p></div>';
@@ -536,7 +542,7 @@ class IWP_MMB_Core extends IWP_MMB_Helper
536
 
537
  if (!$this->is_server_writable()) {
538
  return array(
539
- 'error' => 'Failed, please <a target="_blank" href="http://infinitewp.com/user-guide#ftp">add FTP details for automatic upgrades.</a></a>'
540
  );
541
  }
542
 
82
  if( is_network_admin() && $this->network_admin_install == '1'){
83
  add_action('network_admin_notices', array( &$this, 'network_admin_notice' ));
84
  } else if( $this->network_admin_install != '1' ){
85
+ //$parent_key = $this->get_parent_blog_option('iwp_client_public_key');//IWP commented to show notice to all subsites of network
86
+ //if(empty($parent_key))//IWP commented to show notice to all subsites of network
87
  add_action('admin_notices', array( &$this, 'admin_notice' ));
88
  }
89
  } else {
193
  */
194
  function network_admin_notice()
195
  {
196
+ echo '<div class="error" style="text-align: center;"><p style="font-size: 14px; font-weight: bold; color:#c00;">Attention !</p>
197
+ <p>The InfiniteWP client plugin has to be activated on individual sites. Kindly deactivate the plugin from the network admin dashboard and activate them from the individual dashboards.</p></div>';
 
198
  }
199
 
200
 
205
  function admin_notice()
206
  {
207
  /* IWP */
208
+ if(defined('MULTISITE') && MULTISITE == true){
209
+ global $blog_id;
210
+ $user_id_from_email = get_user_id_from_string( get_blog_option($blog_id, 'admin_email'));
211
+ $details = get_userdata($user_id_from_email);
212
+ $username = $details->user_login;
213
+ }
214
+ else{
215
+ $current_user = wp_get_current_user();
216
+ $username = $current_user->data->user_login;
217
+ }
218
+
219
  echo '<div class="updated" style="text-align: center;"><p style="color: green; font-size: 14px; font-weight: bold;">Add this site to IWP Admin panel</p><p>
220
  <table border="0" align="center">
221
  <tr><td align="right">WEBSITE URL:</td><td align="left"><strong>'.get_option('home').'/</strong></td></tr>
222
+ <tr><td align="right">ADMIN USERNAME:</td><td align="left"><strong>'.$username.'</strong> (or any admin id)</td></tr>
223
  <tr><td align="right">ACTIVATION KEY:</td><td align="left"><strong>'.get_option('iwp_client_activate_key').'</strong></td></tr>
224
  </table>
225
  </p></div>';
542
 
543
  if (!$this->is_server_writable()) {
544
  return array(
545
+ 'error' => 'Failed, please add FTP details for automatic upgrades.'
546
  );
547
  }
548
 
init.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: InfiniteWP - Client
4
  Plugin URI: http://infinitewp.com/
5
  Description: This is the client plugin of InfiniteWP that communicates with the InfiniteWP Admin panel.
6
  Author: Revmakx
7
- Version: 1.0.0
8
  Author URI: http://www.revmakx.com
9
  */
10
  /************************************************************
@@ -26,7 +26,7 @@ Author URI: http://www.revmakx.com
26
  **************************************************************/
27
 
28
  if(!defined('IWP_MMB_CLIENT_VERSION'))
29
- define('IWP_MMB_CLIENT_VERSION', '1.0.0');
30
 
31
  if ( !defined('IWP_MMB_XFRAME_COOKIE')){
32
  $siteurl = function_exists('get_site_option') ? get_site_option( 'siteurl' ) : get_option('siteurl');
@@ -43,23 +43,10 @@ $iwp_mmb_plugin_url = WP_PLUGIN_URL . '/' . basename(dirname(__FILE__));
43
 
44
  require_once("$iwp_mmb_plugin_dir/helper.class.php");
45
  require_once("$iwp_mmb_plugin_dir/core.class.php");
46
- /*
47
- //IWP Remove starts here
48
- require_once("$iwp_mmb_plugin_dir/post.class.php");
49
- require_once("$iwp_mmb_plugin_dir/comment.class.php");
50
- //IWP Remove ends here
51
- */
52
  require_once("$iwp_mmb_plugin_dir/stats.class.php");
53
  require_once("$iwp_mmb_plugin_dir/backup.class.php");
54
  require_once("$iwp_mmb_plugin_dir/installer.class.php");
55
- /*
56
- //IWP Remove starts here
57
- require_once("$iwp_mmb_plugin_dir/link.class.php");
58
- require_once("$iwp_mmb_plugin_dir/user.class.php");
59
- //IWP Remove ends here
60
- */
61
  require_once("$iwp_mmb_plugin_dir/api.php");
62
-
63
  require_once("$iwp_mmb_plugin_dir/plugins/search/search.php");
64
  require_once("$iwp_mmb_plugin_dir/plugins/cleanup/cleanup.php");
65
 
@@ -75,8 +62,14 @@ if( !function_exists ('iwp_mmb_parse_request')) {
75
 
76
  global $current_user, $iwp_mmb_core, $new_actions, $wp_db_version, $wpmu_version, $_wp_using_ext_object_cache;
77
  $data = base64_decode($HTTP_RAW_POST_DATA);
78
- if ($data)
79
- $num = @extract(unserialize($data));
 
 
 
 
 
 
80
 
81
  if (isset($iwp_action)) {
82
  $action = $iwp_action;
@@ -293,65 +286,6 @@ if( !function_exists ( 'iwp_mmb_pre_init_stats' )) {
293
  }
294
  }
295
 
296
- /*
297
- //IWP Remove starts here
298
- //post
299
- if( !function_exists ( 'iwp_mmb_post_create' )) {
300
- function iwp_mmb_post_create($params)
301
- {
302
- global $iwp_mmb_core;
303
- $iwp_mmb_core->get_post_instance();
304
- $return = $iwp_mmb_core->post_instance->create($params);
305
- if (is_int($return))
306
- iwp_mmb_response($return, true);
307
- else{
308
- if(isset($return['error'])){
309
- iwp_mmb_response($return['error'], false);
310
- } else {
311
- iwp_mmb_response($return, false);
312
- }
313
- }
314
- }
315
- }
316
-
317
- if( !function_exists ( 'iwp_mmb_change_post_status' )) {
318
- function iwp_mmb_change_post_status($params)
319
- {
320
- global $iwp_mmb_core;
321
- $iwp_mmb_core->get_post_instance();
322
- $return = $iwp_mmb_core->post_instance->change_status($params);
323
- //iwp_mmb_response($return, true);
324
-
325
- }
326
- }
327
-
328
- //comments
329
- if( !function_exists ( 'iwp_mmb_change_comment_status' )) {
330
- function iwp_mmb_change_comment_status($params)
331
- {
332
- global $iwp_mmb_core;
333
- $iwp_mmb_core->get_comment_instance();
334
- $return = $iwp_mmb_core->comment_instance->change_status($params);
335
- //iwp_mmb_response($return, true);
336
- if ($return){
337
- $iwp_mmb_core->get_stats_instance();
338
- iwp_mmb_response($iwp_mmb_core->stats_instance->get_comments_stats($params), true);
339
- }else
340
- iwp_mmb_response('Comment not updated', false);
341
- }
342
-
343
- }
344
- if( !function_exists ( 'iwp_mmb_comment_stats_get' )) {
345
- function iwp_mmb_comment_stats_get($params)
346
- {
347
- global $iwp_mmb_core;
348
- $iwp_mmb_core->get_stats_instance();
349
- iwp_mmb_response($iwp_mmb_core->stats_instance->get_comments_stats($params), true);
350
- }
351
- }
352
- //IWP Remove ends here
353
- */
354
-
355
  if( !function_exists ( 'iwp_mmb_backup_now' )) {
356
  //backup
357
  function iwp_mmb_backup_now($params)
@@ -383,25 +317,6 @@ if( !function_exists ( 'iwp_mmb_run_task_now' )) {
383
  }
384
  }
385
 
386
- /*
387
- //IWP Remove starts here
388
- if( !function_exists ( 'iwp_mmb_email_backup' )) {
389
- function iwp_mmb_email_backup($params)
390
- {
391
- global $iwp_mmb_core;
392
- $iwp_mmb_core->get_backup_instance();
393
- $return = $iwp_mmb_core->backup_instance->email_backup($params);
394
-
395
- if (is_array($return) && array_key_exists('error', $return))
396
- iwp_mmb_response($return['error'], false);
397
- else {
398
- iwp_mmb_response($return, true);
399
- }
400
- }
401
- }
402
- //IWP Remove ends here
403
- */
404
-
405
  if( !function_exists ( 'iwp_mmb_check_backup_compat' )) {
406
  function iwp_mmb_check_backup_compat($params)
407
  {
@@ -476,24 +391,6 @@ if( !function_exists ( 'iwp_mmb_restore_now' )) {
476
  }
477
  }
478
 
479
- /*
480
- //IWP Remove starts here
481
- if( !function_exists ( 'iwp_mmb_remote_backup_now' )) {
482
- function iwp_mmb_remote_backup_now($params)
483
- {
484
- global $iwp_mmb_core;
485
- $backup_instance = $iwp_mmb_core->get_backup_instance();
486
- $return = $iwp_mmb_core->backup_instance->remote_backup_now($params);
487
- if (is_array($return) && array_key_exists('error', $return))
488
- iwp_mmb_response($return['error'], false);
489
- else
490
- iwp_mmb_response($return, true);
491
- }
492
- }
493
- //IWP Remove ends here
494
- */
495
-
496
-
497
  if( !function_exists ( 'iwp_mmb_clean_orphan_backups' )) {
498
  function iwp_mmb_clean_orphan_backups()
499
  {
@@ -532,21 +429,7 @@ if( !function_exists ( 'iwp_mmb_search_posts_by_term' )) {
532
  $search_type = trim($params['search_type']);
533
  $search_term = strtolower(trim($params['search_term']));
534
 
535
- switch ($search_type){
536
- /*
537
- //IWP Remove starts here
538
- case 'page_post':
539
- $return = $iwp_mmb_core->search_instance->iwp_mmb_search_posts_by_term($params);
540
- if($return){
541
- $return = serialize($return);
542
- iwp_mmb_response($return, true);
543
- }else{
544
- iwp_mmb_response('No posts found', false);
545
- }
546
- break;
547
- //IWP Remove ends here
548
- */
549
-
550
  case 'plugin':
551
  $plugins = get_option('active_plugins');
552
 
@@ -605,65 +488,6 @@ if( !function_exists ( 'iwp_mmb_do_upgrade' )) {
605
 
606
  }
607
  }
608
- /*
609
- //IWP Remove starts here
610
- if( !function_exists ( 'iwp_mmb_add_link' )) {
611
- function iwp_mmb_add_link($params)
612
- {
613
- global $iwp_mmb_core;
614
- $iwp_mmb_core->get_link_instance();
615
- $return = $iwp_mmb_core->link_instance->add_link($params);
616
- if (is_array($return) && array_key_exists('error', $return))
617
-
618
- iwp_mmb_response($return['error'], false);
619
- else {
620
- iwp_mmb_response($return, true);
621
- }
622
-
623
- }
624
- }
625
-
626
- if( !function_exists ( 'iwp_mmb_add_user' )) {
627
- function iwp_mmb_add_user($params)
628
- {
629
- global $iwp_mmb_core;
630
- $iwp_mmb_core->get_user_instance();
631
- $return = $iwp_mmb_core->user_instance->add_user($params);
632
- if (is_array($return) && array_key_exists('error', $return))
633
-
634
- iwp_mmb_response($return['error'], false);
635
- else {
636
- iwp_mmb_response($return, true);
637
- }
638
-
639
- }
640
- }
641
-
642
- if( !function_exists ('iwp_mmb_get_users')) {
643
- function iwp_mmb_get_users($params)
644
- {
645
- global $iwp_mmb_core;
646
- $iwp_mmb_core->get_user_instance();
647
- $return = $iwp_mmb_core->user_instance->get_users($params);
648
- if (is_array($return) && array_key_exists('error', $return))
649
- iwp_mmb_response($return['error'], false);
650
- else {
651
- iwp_mmb_response($return, true);
652
- }
653
- }
654
- }
655
-
656
- if( !function_exists ('iwp_mmb_edit_users')) {
657
- function iwp_mmb_edit_users($params)
658
- {
659
- global $iwp_mmb_core;
660
- $iwp_mmb_core->get_user_instance();
661
- $return = $iwp_mmb_core->user_instance->edit_users($params);
662
- iwp_mmb_response($return, true);
663
- }
664
- }
665
- //IWP Remove ends here
666
- */
667
 
668
  if( !function_exists ( 'iwp_mmb_iframe_plugins_fix' )) {
669
  function iwp_mmb_iframe_plugins_fix($update_actions)
@@ -677,20 +501,7 @@ if( !function_exists ( 'iwp_mmb_iframe_plugins_fix' )) {
677
 
678
  }
679
  }
680
- /*
681
- //IWP Remove starts here
682
- if( !function_exists ( 'iwp_mmb_execute_php_code' )) {
683
- function iwp_mmb_execute_php_code($params)
684
- {
685
- ob_start();
686
- eval($params['code']);
687
- $return = ob_get_flush();
688
- iwp_mmb_response(print_r($return, true), true);
689
- }
690
- }
691
 
692
- //IWP Remove ends here
693
- */
694
  if( !function_exists ( 'iwp_mmb_set_notifications' )) {
695
  function iwp_mmb_set_notifications($params)
696
  {
@@ -730,35 +541,6 @@ if(!function_exists('iwp_mmb_more_reccurences')){
730
  }
731
  }
732
 
733
-
734
- if (!wp_next_scheduled('iwp_client_backup_tasks')) {
735
- wp_schedule_event( time(), 'tenminutes', 'iwp_client_backup_tasks' );
736
- }
737
- add_action('iwp_client_backup_tasks', 'iwp_check_backup_tasks');
738
-
739
-
740
-
741
- /*
742
- //IWP Remove starts here
743
- if( !function_exists('iwp_check_backup_tasks') ){
744
- function iwp_check_backup_tasks() {
745
- global $iwp_mmb_core, $_wp_using_ext_object_cache;
746
- $_wp_using_ext_object_cache = false;
747
-
748
- $iwp_mmb_core->get_backup_instance();
749
- $iwp_mmb_core->backup_instance->check_backup_tasks();
750
- }
751
- }
752
-
753
- if (!wp_next_scheduled('iwp_client_notifications')) {
754
- wp_schedule_event( time(), 'twicedaily', 'iwp_client_notifications' );
755
- }
756
- add_action('iwp_client_notifications', 'iwp_check_notifications');
757
-
758
- //IWP Remove ends here
759
- */
760
-
761
-
762
  if( !function_exists('iwp_check_notifications') ){
763
  function iwp_check_notifications() {
764
  global $iwp_mmb_core, $_wp_using_ext_object_cache;
@@ -788,17 +570,6 @@ if( !function_exists('iwp_mmb_edit_plugins_themes') ){
788
  }
789
  }
790
 
791
- /*
792
- //IWP Remove starts here
793
- if( !function_exists('iwp_mmb_client_brand')){
794
- function iwp_mmb_client_brand($params) {
795
- update_option("iwp_client_brand",$params['brand']);
796
- iwp_mmb_response(true, true);
797
- }
798
- }
799
- //IWP Remove ends here
800
- */
801
-
802
  if( !function_exists('iwp_mmb_maintenance_mode')){
803
  function iwp_mmb_maintenance_mode( $params ) {
804
  global $wp_object_cache;
4
  Plugin URI: http://infinitewp.com/
5
  Description: This is the client plugin of InfiniteWP that communicates with the InfiniteWP Admin panel.
6
  Author: Revmakx
7
+ Version: 1.0.2
8
  Author URI: http://www.revmakx.com
9
  */
10
  /************************************************************
26
  **************************************************************/
27
 
28
  if(!defined('IWP_MMB_CLIENT_VERSION'))
29
+ define('IWP_MMB_CLIENT_VERSION', '1.0.2');
30
 
31
  if ( !defined('IWP_MMB_XFRAME_COOKIE')){
32
  $siteurl = function_exists('get_site_option') ? get_site_option( 'siteurl' ) : get_option('siteurl');
43
 
44
  require_once("$iwp_mmb_plugin_dir/helper.class.php");
45
  require_once("$iwp_mmb_plugin_dir/core.class.php");
 
 
 
 
 
 
46
  require_once("$iwp_mmb_plugin_dir/stats.class.php");
47
  require_once("$iwp_mmb_plugin_dir/backup.class.php");
48
  require_once("$iwp_mmb_plugin_dir/installer.class.php");
 
 
 
 
 
 
49
  require_once("$iwp_mmb_plugin_dir/api.php");
 
50
  require_once("$iwp_mmb_plugin_dir/plugins/search/search.php");
51
  require_once("$iwp_mmb_plugin_dir/plugins/cleanup/cleanup.php");
52
 
62
 
63
  global $current_user, $iwp_mmb_core, $new_actions, $wp_db_version, $wpmu_version, $_wp_using_ext_object_cache;
64
  $data = base64_decode($HTTP_RAW_POST_DATA);
65
+ if ($data){
66
+ //$num = @extract(unserialize($data));
67
+ $unserialized_data = unserialize($data);
68
+ $iwp_action = $unserialized_data['iwp_action'];
69
+ $params = $unserialized_data['params'];
70
+ $id = $unserialized_data['id'];
71
+ $signature = $unserialized_data['signature'];
72
+ }
73
 
74
  if (isset($iwp_action)) {
75
  $action = $iwp_action;
286
  }
287
  }
288
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  if( !function_exists ( 'iwp_mmb_backup_now' )) {
290
  //backup
291
  function iwp_mmb_backup_now($params)
317
  }
318
  }
319
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
  if( !function_exists ( 'iwp_mmb_check_backup_compat' )) {
321
  function iwp_mmb_check_backup_compat($params)
322
  {
391
  }
392
  }
393
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
  if( !function_exists ( 'iwp_mmb_clean_orphan_backups' )) {
395
  function iwp_mmb_clean_orphan_backups()
396
  {
429
  $search_type = trim($params['search_type']);
430
  $search_term = strtolower(trim($params['search_term']));
431
 
432
+ switch ($search_type){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  case 'plugin':
434
  $plugins = get_option('active_plugins');
435
 
488
 
489
  }
490
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
 
492
  if( !function_exists ( 'iwp_mmb_iframe_plugins_fix' )) {
493
  function iwp_mmb_iframe_plugins_fix($update_actions)
501
 
502
  }
503
  }
 
 
 
 
 
 
 
 
 
 
 
504
 
 
 
505
  if( !function_exists ( 'iwp_mmb_set_notifications' )) {
506
  function iwp_mmb_set_notifications($params)
507
  {
541
  }
542
  }
543
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
544
  if( !function_exists('iwp_check_notifications') ){
545
  function iwp_check_notifications() {
546
  global $iwp_mmb_core, $_wp_using_ext_object_cache;
570
  }
571
  }
572
 
 
 
 
 
 
 
 
 
 
 
 
573
  if( !function_exists('iwp_mmb_maintenance_mode')){
574
  function iwp_mmb_maintenance_mode( $params ) {
575
  global $wp_object_cache;
installer.class.php CHANGED
@@ -133,7 +133,7 @@ class IWP_MMB_Installer extends IWP_MMB_Core
133
 
134
  if (!$this->is_server_writable()) {
135
  return array(
136
- 'error' => 'Failed, please <a target="_blank" href="http://infinitewp.com/user-guide#ftp">add FTP details</a></a>'
137
  );
138
  }
139
 
@@ -651,20 +651,6 @@ class IWP_MMB_Installer extends IWP_MMB_Core
651
  }
652
 
653
  }
654
- /***************** Displaying all plugins so Not using serach function - Commented by IWP ******************/
655
- /*if ($search) {
656
- foreach ($plugins['active'] as $k => $plugin) {
657
- if (!stristr($plugin['name'], $search)) {
658
- unset($plugins['active'][$k]);
659
- }
660
- }
661
-
662
- foreach ($plugins['inactive'] as $k => $plugin) {
663
- if (!stristr($plugin['name'], $search)) {
664
- unset($plugins['inactive'][$k]);
665
- }
666
- }
667
- }*/
668
  }
669
  }
670
 
133
 
134
  if (!$this->is_server_writable()) {
135
  return array(
136
+ 'error' => 'Failed, please add FTP details'
137
  );
138
  }
139
 
651
  }
652
 
653
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
654
  }
655
  }
656
 
readme.txt CHANGED
@@ -5,11 +5,12 @@ Requires at least: 3.0
5
  Tested up to: 3.3.2
6
  Stable tag: trunk
7
 
8
- This is the client plugin of InfiniteWP that communicates with the InfiniteWP Admin Panel.
 
9
 
10
  == Description ==
11
 
12
- [InfiniteWP](http://infinitewp.com/ "Manage Multiple Wordpress") allows users to manage unlimited number of Wordpress sites from their own server.
13
 
14
  Main features:
15
 
@@ -21,29 +22,36 @@ Main features:
21
  * Bulk Install plugins & themes in multiple sites at once
22
  * and more..
23
 
24
- Check out the [InfiniteWP Overview Video](http://www.youtube.com/watch?v=mam6hA-CKGc) below.
25
 
26
- http://www.youtube.com/watch?v=mam6hA-CKGc
27
 
28
- Check out [InfiniteWP.com](http://infinitewp.com/ "Manage Multiple Wordpress").
29
 
30
  == Installation ==
31
 
32
  1. Upload the plugin folder to your /wp-content/plugins/ folder
33
  2. Go to the Plugins page and activate InfiniteWP Client
34
- 3. If you have not yet installed the InfiniteWP Admin Panel, visit [InfiniteWP.com](http://infinitewp.com/ "Manage Multiple Wordpress"), download the free InfiniteWP Admin Panel & install on your server.
35
- 4. Add your Wordpress site to the InfiniteWP Admin Panel and start using it.
36
 
37
  == Screenshots ==
38
 
39
  1. Sites & Group Management
40
- 2. Search Wordpress Plugin Repository
41
  3. Bulk Plugin & Theme Management
42
- 4. One-click access to Wordpress admin panels
43
  5. One-click updates
44
 
45
  == Changelog ==
46
 
 
 
 
 
 
 
 
47
  = 1.0.0 =
48
  * Public release
49
  * Bugs fixed
5
  Tested up to: 3.3.2
6
  Stable tag: trunk
7
 
8
+ Install this plugin on unlimited sites and manage them all from a central dashboard.
9
+ This plugin communicates with your InfiniteWP Admin Panel.
10
 
11
  == Description ==
12
 
13
+ [InfiniteWP](http://infinitewp.com/ "Manage Multiple WordPress") allows users to manage unlimited number of WordPress sites from their own server.
14
 
15
  Main features:
16
 
22
  * Bulk Install plugins & themes in multiple sites at once
23
  * and more..
24
 
25
+ Check out the [InfiniteWP Overview Video](http://www.youtube.com/watch?v=IOu7LdyPOSs) below.
26
 
27
+ http://www.youtube.com/watch?v=IOu7LdyPOSs
28
 
29
+ Check out [InfiniteWP.com](http://infinitewp.com/ "Manage Multiple WordPress").
30
 
31
  == Installation ==
32
 
33
  1. Upload the plugin folder to your /wp-content/plugins/ folder
34
  2. Go to the Plugins page and activate InfiniteWP Client
35
+ 3. If you have not yet installed the InfiniteWP Admin Panel, visit [InfiniteWP.com](http://infinitewp.com/ "Manage Multiple WordPress"), download the free InfiniteWP Admin Panel & install on your server.
36
+ 4. Add your WordPress site to the InfiniteWP Admin Panel and start using it.
37
 
38
  == Screenshots ==
39
 
40
  1. Sites & Group Management
41
+ 2. Search WordPress Plugin Repository
42
  3. Bulk Plugin & Theme Management
43
+ 4. One-click access to WordPress admin panels
44
  5. One-click updates
45
 
46
  == Changelog ==
47
 
48
+ = 1.0.2 =
49
+ * Bugs fixed
50
+
51
+ = 1.0.1 =
52
+ * WordPress Multisite support
53
+ * Bugs fixed
54
+
55
  = 1.0.0 =
56
  * Public release
57
  * Bugs fixed
stats.class.php CHANGED
@@ -240,13 +240,7 @@ class IWP_MMB_Stats extends IWP_MMB_Core
240
 
241
  function get_backups($stats, $options = array())
242
  {
243
- $stats['iwp_backups'] = $this->get_backup_instance()->get_backup_stats();
244
- /*
245
- //IWP Remove starts here
246
- $stats['iwp_next_backups'] = $this->get_backup_instance()->get_next_schedules();
247
- //IWP Remove ends here
248
- */
249
-
250
  return $stats;
251
  }
252
 
@@ -749,8 +743,6 @@ $stats['iwp_next_backups'] = $this->get_backup_instance()->get_next_schedules();
749
  delete_option('iwp_client_pageview_alerts');
750
  }
751
  }
752
-
753
-
754
  }
755
 
756
 
240
 
241
  function get_backups($stats, $options = array())
242
  {
243
+ $stats['iwp_backups'] = $this->get_backup_instance()->get_backup_stats();
 
 
 
 
 
 
244
  return $stats;
245
  }
246
 
743
  delete_option('iwp_client_pageview_alerts');
744
  }
745
  }
 
 
746
  }
747
 
748