Plugin Directory

Changeset 661130


Ignore:
Timestamp:
01/30/2013 06:40:02 AM (13 years ago)
Author:
paulgpetty
Message:

3.0.00 officially drops PHP4

Location:
wp-time-machine/trunk
Files:
4 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • wp-time-machine/trunk/includes/wpTimeMachineCore.php

    r539005 r661130  
    106106    // array with translatable text ...
    107107    $wpTimeMachineText = unserialize(wpTimeMachineText);
    108 
    109     // PHP4 is currently forced to use FTP exclusively
    110     if (wpTimeMachinePHP == 'php4') {
    111         $offsite = 'ftp';
    112     }
    113108
    114109    $use_log = $wpTimeMachineOptionsStorage['use_log'];
     
    230225            }
    231226       
    232             if (wpTimeMachinePHP == 'php4') {
    233            
    234                 $js_offsite = "ftp";
    235                
    236             } else {
    237            
    238                 $js_offsite = $wpTimeMachineOptionsStorage['offsite'];
    239            
    240             }
     227            $js_offsite = $wpTimeMachineOptionsStorage['offsite'];
    241228       
    242229        ?>
    243230
    244231        var offsite           = "<?php echo $js_offsite; ?>";
    245         var wpTimeMachinePHP  = "<?php echo wpTimeMachinePHP; ?>";
    246232        var __nonce__         = "<?php echo wp_create_nonce('wpTimeMachine_ajax_nonce'); ?>";
    247233        var remote_pass_label = <?php echo $wpTimeMachineOptionsStorage['offsite']; ?>_labels[1];
     
    275261
    276262        }
    277        
    278         // var show_info_labels = new Array(
    279         //     "<?php echo $wpTimeMachineText['show_info_labels'][0]; ?>",
    280         //     "<?php echo $wpTimeMachineText['show_info_labels'][1]; ?>"
    281         // );
    282263   
    283264        var use_log_labels = new Array(
     
    285266            "<?php echo $wpTimeMachineText['use_log_labels'][1]; ?>"
    286267        );
    287    
    288         // var show_options_labels = new Array(
    289         //     "<?php echo $wpTimeMachineText['show_options_labels'][0]; ?>",
    290         //     "<?php echo $wpTimeMachineText['show_options_labels'][1]; ?>"
    291         // );
    292268   
    293269        var format_labels = new Array(
     
    446422
    447423                    <?php
    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                    &nbsp;&nbsp;<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 != "") {
    450458                        ?>
    451 
    452                         <label for="offsite" class="offsite">
    453                         Current offsite service: <strong>FTP</strong> <em> PHP4 only has support for FTP </em>
    454                         </label> <br />
    455                         <input type="hidden" name="offsite" value="ftp">
    456 
     459                        </span>
    457460                        <?php
    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                         &nbsp;&nbsp;<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                
    498461                    }
    499462               
     
    658621            <div id="Info">
    659622           
    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 &amp; 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>
    661697
    662698            </div>
     
    807843            $POST_remote_host = $_POST['remote_host'];
    808844
    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
    814952
    815953            if (! $login_error) {
     
    10381176register_deactivation_hook('wp-time-machine/wp-time-machine.php', 'wpTimeMachine_deactivate');
    10391177
    1040 
  • wp-time-machine/trunk/includes/wpTimeMachineCron.php

    r311204 r661130  
    6363define( 'wpTimeMachineOffsites', serialize($wpTimeMachineOffsites) );
    6464
    65 // Branching:
    66  
    67 if (version_compare(phpversion(), '5', '>=') && function_exists("curl_version")) {
    68     define( 'wpTimeMachinePHP', 'php5' );
    69 } else {
    70     define( 'wpTimeMachinePHP', 'php4' );
    71 }
    72 
    7365// Actual init call:
    7466
     
    7870// 2-dimensional array with all offsite provider's metadata
    7971$offsites = unserialize(wpTimeMachineOffsites);
    80 
    81 if (wpTimeMachinePHP == 'php4') {
    82     $offsite = 'ftp';
    83 }
    8472
    8573if ($wpTimeMachineOptionsStorage['format'] == "zip") {
     
    207195$POST_remote_host = $wpTimeMachineOptionsStorage['remote_host'];
    208196
    209 if (wpTimeMachinePHP == 'php4') {
    210     require "includes/wpTimeMachineNonSwitch.php4";
    211 } else {
    212     require "includes/wpTimeMachineSwitch.php5";
    213 }
     197require "includes/wpTimeMachineSwitch.php5";
    214198
    215199?>
  • wp-time-machine/trunk/javascript/wp-time-machine.js

    r661122 r661130  
    6666    wpTimeMachine_toggle_host_field(offsite);
    6767
    68     if (wpTimeMachinePHP == 'php4') {
    69         jQuery("label[for='remote_user']").text(ftp_labels[0] + ": ");
    70         jQuery("label[for='remote_pass']").text(ftp_labels[1] + ": ");
    71         jQuery("label[for='remote_path']").text(ftp_labels[2] + ": ");
    72         jQuery(".remote_pass_label").text(ftp_labels[1]);
    73         jQuery(".offsite_name").text(ftp_labels[3]);
    74     } else {
    75         jQuery(".remote_pass_label").text(remote_pass_label);
    76     }
     68    jQuery(".remote_pass_label").text(remote_pass_label);
    7769
    7870    jQuery("a[value='false']").each(function () {
  • wp-time-machine/trunk/readme.txt

    r661128 r661130  
    44Requires at least: 3.0.0
    55Tested up to: 3.5.1
    6 Stable tag: 2.0.20
     6Stable tag: 3.0.00
    77
    88== Description ==
     
    2929Check out http://wptimemachine.com for more information.
    3030
    31 __This Plugin requires PHP5 for all of its features!__
    32 
    33 With PHP4, the only offsite service capable of working at this time is FTP.
     31__This Plugin requires PHP5 (Version 2.0.20 was the last release to support PHP4)__
    3432
    3533== Installation ==
    36 
    37 __This Plugin requires PHP5 for all of its features!__
    38 
    39 With PHP4, the only offsite service capable of working at this time is FTP.
    4034
    4135The easiest way to install:
  • wp-time-machine/trunk/wp-time-machine.php

    r661128 r661130  
    44Plugin URI: http://wordpress.org/extend/plugins/wp-time-machine/
    55Description: Creates an archive of all your WordPress Data & Files and then stores them on Dropbox, Amazon's S3, or your FTP host.
    6 Version: 2.0.20
     6Version: 3.0.00
    77Author: Paul G Petty
    88Author URI: http://wpTimeMachine.com
     
    1111// wp Time Machine, Version:
    1212
    13     define( 'wpTimeMachineVersion', '2.0.20' );
     13    define( 'wpTimeMachineVersion', '3.0.00' );
    1414
    1515// wp specific definitions:
     
    6969            'offsite_name'      => 'Dropbox',
    7070            'offsite_short'     => 'dropbox',
    71             'offsite'           => 'dropbox',
    72            
    73             'include'           => 'includes/DropboxUploader.php'
     71            'offsite'           => 'dropbox'
    7472   
    7573        ),
     
    8280            'offsite_name'      => 'Amazon S3',
    8381            'offsite_short'     => 's3',
    84             'offsite'           => 'aws_s3',
    85            
    86             'include'           => 'includes/S3.php'
     82            'offsite'           => 'aws_s3'
    8783   
    8884        ),
     
    9591            'offsite_name'      => 'FTP',
    9692            'offsite_short'     => 'ftp',
    97             'offsite'           => 'ftp',
    98    
    99             'include'           => ''
     93            'offsite'           => 'ftp'
    10094           
    10195        )
     
    145139   
    146140    define( 'wpTimeMachineText', serialize($wpTimeMachineText) );
    147        
    148 // Branching:
    149      
    150     if (version_compare(phpversion(), '5', '>=') && function_exists("curl_version")) {
    151141
    152         define( 'wpTimeMachinePHP', 'php5' );
     142// offsite specific libraries
    153143
    154         require( $wpTimeMachineOffsites['dropbox']['include'] );
    155         require( $wpTimeMachineOffsites['s3']['include'] );
    156    
    157     } else {
    158 
    159         define( 'wpTimeMachinePHP', 'php4' );
    160        
    161     }
    162 
     144    require('includes/DropboxUploader.php');
     145    require('includes/S3.php');
     146     
    163147// "Universal" includes:
    164148     
Note: See TracChangeset for help on using the changeset viewer.