| 448 | | |
| 449 | | if (wpTimeMachinePHP == 'php4') { |
| | 424 | |
| | 425 | if ($offsite != "") { |
| | 426 | ?> |
| | 427 | |
| | 428 | <label for="offsite" class="offsite"> |
| | 429 | Current offsite service: <strong class="offsite_name"><?php echo $offsite_name; ?></strong> |
| | 430 | <a href="javascript:;" onclick="jQuery('#offsite_selections').toggle()">Change your offsite service</a> |
| | 431 | </label> <br /> |
| | 432 | <span id="offsite_selections" style="display:none"> |
| | 433 | |
| | 434 | <?php |
| | 435 | } else { |
| | 436 | ?> |
| | 437 | |
| | 438 | <label for="offsite">Select an offsite service:</label> <br /> |
| | 439 | |
| | 440 | <?php |
| | 441 | } |
| | 442 | ?> |
| | 443 | |
| | 444 | <?php |
| | 445 | |
| | 446 | foreach ($offsites as $provider) { |
| | 447 | echo "<input class=\"rd\" type=\"radio\" name=\"offsite\" value=\"".$provider['offsite_short']."\"> ".$provider['offsite_name']." "; |
| | 448 | } |
| | 449 | |
| | 450 | ?> |
| | 451 | |
| | 452 | <script type="text/javascript"> |
| | 453 | jQuery("input[value='<?php echo $offsite; ?>']").attr("checked", true); |
| | 454 | </script> |
| | 455 | |
| | 456 | <?php |
| | 457 | if ($offsite != "") { |
| 458 | | } else { |
| 459 | | |
| 460 | | if ($offsite != "") { |
| 461 | | ?> |
| 462 | | |
| 463 | | <label for="offsite" class="offsite"> |
| 464 | | Current offsite service: <strong class="offsite_name"><?php echo $offsite_name; ?></strong> |
| 465 | | <a href="javascript:;" onclick="jQuery('#offsite_selections').toggle()">Change your offsite service</a> |
| 466 | | </label> <br /> |
| 467 | | <span id="offsite_selections" style="display:none"> |
| 468 | | |
| 469 | | <?php |
| 470 | | } else { |
| 471 | | ?> |
| 472 | | |
| 473 | | <label for="offsite">Select an offsite service:</label> <br /> |
| 474 | | |
| 475 | | <?php |
| 476 | | } |
| 477 | | ?> |
| 478 | | |
| 479 | | <?php |
| 480 | | |
| 481 | | foreach ($offsites as $provider) { |
| 482 | | echo "<input class=\"rd\" type=\"radio\" name=\"offsite\" value=\"".$provider['offsite_short']."\"> ".$provider['offsite_name']." "; |
| 483 | | } |
| 484 | | |
| 485 | | ?> |
| 486 | | |
| 487 | | <script type="text/javascript"> |
| 488 | | jQuery("input[value='<?php echo $offsite; ?>']").attr("checked", true); |
| 489 | | </script> |
| 490 | | |
| 491 | | <?php |
| 492 | | if ($offsite != "") { |
| 493 | | ?> |
| 494 | | </span> |
| 495 | | <?php |
| 496 | | } |
| 497 | | |
| 660 | | <?php require 'wpTimeMachineIntructions.' . wpTimeMachinePHP . '.html'; ?> |
| | 623 | <p> |
| | 624 | |
| | 625 | This plugin is pretty simple. You can use Dropbox, Amazon's S3, or an FTP account to store WordPress. Need an account? |
| | 626 | Visit: <a href="https://www.dropbox.com/referrals/NTE0ODYwNjc5" target="_new">Dropbox</a>. Or, for Amazon's S3 visit: |
| | 627 | <a href="https://s3.amazonaws.com/" target="_new">https://s3.amazonaws.com</a>. If you decide to use an FTP account, |
| | 628 | it makes a lot of sense to use a remote FTP account on a server that isn't shared with this WordPress installation. |
| | 629 | |
| | 630 | </p> |
| | 631 | |
| | 632 | <p> |
| | 633 | |
| | 634 | The files that get generated for each archive are: |
| | 635 | |
| | 636 | <ol> |
| | 637 | <li>wpTimeMachine-content-files<?php echo $format; ?></li> |
| | 638 | <li>wpTimeMachine-data-files.sql</li> |
| | 639 | <li>wpTimeMachine-htaccess.txt <sup>1</sup></li> |
| | 640 | <li>wpTimeMachine-Instructions.txt <sup>2</sup></li> |
| | 641 | <li>wpTimeMachine-RestorationScript.sh <sup>3</sup></li> |
| | 642 | </ol> |
| | 643 | |
| | 644 | <em> |
| | 645 | 1: if you're not using .htaccess then no, it won't be created <br /> |
| | 646 | 2: if you're ever recovering from a catastrophic WordPress failure, this file will help<br /> |
| | 647 | 3: this file is still under development & should be used with caution<br /> |
| | 648 | </em> |
| | 649 | |
| | 650 | <div class="hint"> |
| | 651 | It's a good idea to store the following two items on your own, (in the same place as the files above):<br/> |
| | 652 | Your copy of WordPress: <a href="<?php echo wp_installer_url.$format;?>"><?php echo wp_installer_url.$format;?></a><br/> |
| | 653 | Or, read about how to use <a href="http://wptimemachine.com/-/wordpress-and-subversion/">Subversion for your WordPress implementation</a>.<br/> |
| | 654 | Your copy of wp-config.php <em>For security purposes this file is not backed up!</em> |
| | 655 | </div> |
| | 656 | |
| | 657 | </p> |
| | 658 | |
| | 659 | <p> |
| | 660 | |
| | 661 | <b>Information about Scheduling (and cron):</b> |
| | 662 | <br /> |
| | 663 | |
| | 664 | <ol> |
| | 665 | <li><?php echo wpcontent_url . "/plugins/wp-time-machine/cron.php"; ?></li> |
| | 666 | <li><?php echo wpcontent_dir . "/plugins/wp-time-machine/cron.php"; ?></li> |
| | 667 | </ol> |
| | 668 | |
| | 669 | For example, you might use curl:<br /> |
| | 670 | |
| | 671 | <code> |
| | 672 | curl "<?php echo wpcontent_url . "/plugins/wp-time-machine/cron.php"; ?>?generate=1" |
| | 673 | </code> |
| | 674 | |
| | 675 | <div class="hint"> |
| | 676 | |
| | 677 | Note that it is recommended that you set up a separate cron job to delete the temporary archive files: |
| | 678 | |
| | 679 | <code> |
| | 680 | curl "<?php echo wpcontent_url . "/plugins/wp-time-machine/cron.php"; ?>?clean=1" |
| | 681 | </code> |
| | 682 | |
| | 683 | </div> |
| | 684 | |
| | 685 | There are many ways to use the scripts referenced above ... this is just an example, for more information read this:<br /> |
| | 686 | <a href="http://wptimemachine.com/-/scheduling-wp-time-machine-via-cron/" target="_new">http://wptimemachine.com/-/scheduling-wp-time-machine-via-cron/</a> |
| | 687 | |
| | 688 | </p> |
| | 689 | |
| | 690 | <p> |
| | 691 | |
| | 692 | Having trouble? Visit the <a href="http://wordpress.org/tags/wp-time-machine?forum_id=10" target="_blank">WordPress forum</a>, and please share |
| | 693 | this URL: <a href="<?php echo wpcontent_url . "/wpTimeMachine_log.txt"; ?>" target="_new"><?php echo wpcontent_url . "/wpTimeMachine_log.txt"; ?></a> |
| | 694 | (the log -- if enabled -- contains vital information for trouble shooting).<br /> |
| | 695 | |
| | 696 | </p> |
| 809 | | if (wpTimeMachinePHP == 'php4') { |
| 810 | | require "wpTimeMachineNonSwitch.php4"; |
| 811 | | } else { |
| 812 | | require "wpTimeMachineSwitch.php5"; |
| 813 | | } |
| | 845 | $login_error = false; |
| | 846 | |
| | 847 | switch ($offsite) { |
| | 848 | |
| | 849 | case "dropbox": |
| | 850 | |
| | 851 | $uploader = new DropboxUploader( $POST_remote_user, $POST_remote_pass ); |
| | 852 | |
| | 853 | wpTimeMachine_logger( $use_log, '--- Instantiate new DropboxUploader() ' ); |
| | 854 | |
| | 855 | if ($POST_remote_path == "") { |
| | 856 | $dropbox_dir = "/wpTimeMachine"; |
| | 857 | } else { |
| | 858 | $dropbox_dir = "/" . $POST_remote_path ; |
| | 859 | } |
| | 860 | |
| | 861 | if ($timestamp != "") { |
| | 862 | $dropbox_dir .= "-" . $timestamp; |
| | 863 | } |
| | 864 | |
| | 865 | foreach ($files as $i => $file) { |
| | 866 | if (file_exists($file)) { |
| | 867 | |
| | 868 | wpTimeMachine_logger( $use_log, '--- files loop: ' . $file . ' >> ' . $dropbox_dir . ' >> ' . baseName( $file ) ); |
| | 869 | |
| | 870 | try { |
| | 871 | |
| | 872 | $uploader->upload( $file, $remoteDir = $dropbox_dir ); |
| | 873 | |
| | 874 | } catch (Exception $e) { |
| | 875 | |
| | 876 | wpTimeMachine_logger( $use_log, '--- error w/ DropboxUploader(): ' . $e ); |
| | 877 | |
| | 878 | $login_error = true; |
| | 879 | |
| | 880 | break; |
| | 881 | |
| | 882 | } |
| | 883 | |
| | 884 | } |
| | 885 | } |
| | 886 | |
| | 887 | $remote_path = $dropbox_dir; |
| | 888 | |
| | 889 | break; |
| | 890 | |
| | 891 | case "aws_s3": |
| | 892 | case "s3": |
| | 893 | |
| | 894 | if ($POST_remote_path == "") { |
| | 895 | $bucket = "wpTimeMachine"; |
| | 896 | } else { |
| | 897 | $bucket = $POST_remote_path ; |
| | 898 | } |
| | 899 | |
| | 900 | if ($timestamp != "") { |
| | 901 | $bucket .= "-" . $timestamp; |
| | 902 | } |
| | 903 | |
| | 904 | $bucket = uniqid( $bucket . "-" ); |
| | 905 | |
| | 906 | $s3 = new S3( $POST_remote_user, $POST_remote_pass ); |
| | 907 | |
| | 908 | wpTimeMachine_logger( $use_log, '--- Instantiate new S3()' ); |
| | 909 | |
| | 910 | try { |
| | 911 | |
| | 912 | $s3->putBucket( $bucket, S3::ACL_PRIVATE ); |
| | 913 | |
| | 914 | } catch (Exception $e) { |
| | 915 | |
| | 916 | wpTimeMachine_logger( $use_log, '--- error w/ S3(): ' . $e ); |
| | 917 | |
| | 918 | $login_error = true; |
| | 919 | |
| | 920 | break; |
| | 921 | |
| | 922 | } |
| | 923 | |
| | 924 | foreach ($files as $i => $file) { |
| | 925 | |
| | 926 | if (file_exists($file)) { |
| | 927 | |
| | 928 | wpTimeMachine_logger( $use_log, '--- files loop: ' . $file . ' >> ' . $bucket . ' >> ' . baseName( $file ) ); |
| | 929 | |
| | 930 | $s3->putObjectFile( $file, $bucket, baseName( $file ), S3::ACL_PRIVATE ); |
| | 931 | |
| | 932 | } |
| | 933 | |
| | 934 | } |
| | 935 | |
| | 936 | $remote_path = $bucket; |
| | 937 | |
| | 938 | break; |
| | 939 | |
| | 940 | case "ftp": |
| | 941 | |
| | 942 | include("wpTimeMachineNonSwitch.php4"); |
| | 943 | |
| | 944 | break; |
| | 945 | |
| | 946 | default: |
| | 947 | |
| | 948 | wpTimeMachine_logger( $use_log, '--- Error: no offsite set, or recognized.' ); |
| | 949 | |
| | 950 | } |
| | 951 | |