Plugin Directory

Changeset 868335


Ignore:
Timestamp:
03/03/2014 04:38:12 AM (12 years ago)
Author:
paulgpetty
Message:

fix label issue for offsite provider

Location:
wp-time-machine/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-time-machine/trunk/css/wp-time-machine.css

    r662458 r868335  
    132132}
    133133
     134#wpTimeMachine label.offsite_provider {
     135width:auto;
     136}
     137
    134138#wpTimeMachine input {
    135139width:205px;
     
    251255}
    252256
    253 a.wpTM_checked:hover, 
     257a.wpTM_checked:hover,
    254258a.wpTM_unchecked {
    255259padding-left:25px;
     
    257261}
    258262
    259 a.wpTM_unchecked:hover, 
     263a.wpTM_unchecked:hover,
    260264a.wpTM_checked {
    261265padding-left:25px;
  • wp-time-machine/trunk/includes/wpTimeMachineCore.php

    r863789 r868335  
    4141        $wpTimeMachineOptionsStorage['use_post_pub'] = $_GET['use_post_pub'];
    4242    }
    43    
     43
    4444    if (isset($_GET['use_timestamp_dir'])) {
    4545        $wpTimeMachineOptionsStorage['use_timestamp_dir'] = $_GET['use_timestamp_dir'];
     
    7979        }
    8080    }
    81    
     81
    8282    if ( $_GET['set_offsite'] == 1 ) {
    83    
     83
    8484        $wpTimeMachineOptionsStorage['offsite'] = $_GET['offsite'];
    85        
     85
    8686        echo "set offsite to: " . $_GET['offsite'];
    87    
    88     }
    89    
     87
     88    }
     89
    9090    update_option(adminOptionsName, $wpTimeMachineOptionsStorage);
    91    
     91
    9292    if ( $_GET['ajax_settings_only'] == 1 ) {
    93    
     93
    9494        exit;
    95    
     95
    9696    }
    9797
     
    118118
    119119    wpTimeMachine_clean( $files );
    120    
     120
    121121    if ($_GET['clean'] == 1) {
    122    
     122
    123123        exit;
    124    
     124
    125125    }
    126                
     126
    127127    if ($wpTimeMachineOptionsStorage['use_timestamp_dir'] == "true") {
    128128        $timestamp = date("Y-m-d");
     
    149149        // Wordpress
    150150        wpTimeMachine_logger( $use_log,  "---     Wordpress: ". wp_version );
    151        
     151
    152152        // WP_ALLOW_MULTISITE info if applicable
    153         if (WP_ALLOW_MULTISITE) {       
     153        if (WP_ALLOW_MULTISITE) {
    154154            wpTimeMachine_logger( $use_log,  "---     WP_ALLOW_MULTISITE: true" );
    155155            wpTimeMachine_logger( $use_log,  "---     DOMAIN_CURRENT_SITE: ".DOMAIN_CURRENT_SITE );
     
    177177        }
    178178        wpTimeMachine_logger( $use_log,  '---     Current Offsite Provider: '.$offsite );
    179    
     179
    180180    }
    181181
     
    200200            echo "#Info {display:none; } ";
    201201        }
    202    
     202
    203203        if ($wpTimeMachineOptionsStorage['show_options'] == "true") {
    204204            echo ".wpTimeMachineOptions {display:block;} ";
     
    206206            echo ".wpTimeMachineOptions {display:none; } ";
    207207        }
    208    
     208
    209209        ?>
    210210
     
    224224                echo "\n\t\t\"\"\n\t);";
    225225            }
    226        
     226
    227227            $js_offsite = $wpTimeMachineOptionsStorage['offsite'];
    228        
     228
    229229        ?>
    230230
     
    240240
    241241            <?php
    242            
     242
    243243            foreach ($offsites as $provider) {
    244244            echo "
     
    252252                    break;";
    253253            }
    254            
     254
    255255            ?>
    256            
     256
    257257                default:
    258258                    // need to add error logging for this... or maybe just re-use FTP or Dropbox
     
    261261
    262262        }
    263    
     263
    264264        var use_log_labels = new Array(
    265             "<?php echo $wpTimeMachineText['use_log_labels'][0]; ?>", 
     265            "<?php echo $wpTimeMachineText['use_log_labels'][0]; ?>",
    266266            "<?php echo $wpTimeMachineText['use_log_labels'][1]; ?>"
    267267        );
    268    
     268
    269269        var format_labels = new Array(
    270             "<?php echo $wpTimeMachineText['format_labels'][0]; ?>", 
     270            "<?php echo $wpTimeMachineText['format_labels'][0]; ?>",
    271271            "<?php echo $wpTimeMachineText['format_labels'][1]; ?>"
    272272        );
    273    
     273
    274274        var use_post_pub_labels = new Array(
    275             "<?php echo $wpTimeMachineText['use_post_pub_labels'][0]; ?>", 
     275            "<?php echo $wpTimeMachineText['use_post_pub_labels'][0]; ?>",
    276276            "<?php echo $wpTimeMachineText['use_post_pub_labels'][1]; ?>"
    277277        );
    278        
     278
    279279        var use_timestamp_dir_labels = new Array(
    280             "<?php echo $wpTimeMachineText['use_timestamp_dir_labels'][0]; ?>", 
     280            "<?php echo $wpTimeMachineText['use_timestamp_dir_labels'][0]; ?>",
    281281            "<?php echo $wpTimeMachineText['use_timestamp_dir_labels'][1]; ?>"
    282282        );
    283    
     283
    284284        var exclude_cache_labels = new Array(
    285             "<?php echo $wpTimeMachineText['exclude_cache_labels'][0]; ?>", 
     285            "<?php echo $wpTimeMachineText['exclude_cache_labels'][0]; ?>",
    286286            "<?php echo $wpTimeMachineText['exclude_cache_labels'][1]; ?>"
    287287        );
    288    
     288
    289289        var remote_pass_storage_labels = new Array(
    290             "<?php echo $wpTimeMachineText['remote_pass_storage_labels'][0]; ?>", 
     290            "<?php echo $wpTimeMachineText['remote_pass_storage_labels'][0]; ?>",
    291291            "<?php echo $wpTimeMachineText['remote_pass_storage_labels'][1]; ?>"
    292292        );
    293    
     293
    294294    </script>
    295    
     295
    296296    <script type="text/javascript" src="<?php echo wpcontent_url; ?>/plugins/wp-time-machine/javascript/wp-time-machine.js"></script>
    297297
     
    301301
    302302        <?php
    303    
     303
    304304        if ($wpTimeMachineOptionsStorage['recent_archive_name'] != "") {
    305    
     305
    306306            echo "<div id=\"RecentInfo\">";
    307307            echo "<h3>Recent Archive Information:</h3>";
     
    310310            echo "<p><a href='javascript:;' onclick='jQuery(\"#RecentInfo\").toggle()' class=\"close\">Close this</a></p>";
    311311            echo "</div>";
    312    
     312
    313313        } else {
    314    
     314
    315315            echo "<div id=\"RecentInfo\">";
    316316            echo "<h3>Your Archive Information:</h3>";
     
    318318            echo "<p><a href='javascript:;' onclick='jQuery(\"#RecentInfo\").toggle()' class=\"close\">Close this</a></p>";
    319319            echo "</div>";
    320    
     320
    321321        }
    322    
     322
    323323        ?>
    324        
     324
    325325        <p>
    326326
     
    419419
    420420                    <?php
    421                
     421
    422422                    if ($offsite != "") {
    423423                    ?>
     
    443443                    foreach ($offsites as $provider) {
    444444                        echo "<input class=\"rd\" type=\"radio\" name=\"offsite\" value=\"".$provider['offsite_short']."\" id=\"offsite_radio_".$provider['offsite_short']."\"> ";
    445                         echo "<label for=\"offsite_radio_".$provider['offsite_short']."\">".$provider['offsite_name']."</label> ";
     445                        echo "<label class=\"offsite_provider\" for=\"offsite_radio_".$provider['offsite_short']."\">".$provider['offsite_name']."</label> ";
    446446                    }
    447                    
     447
    448448                    ?>
    449449
     
    458458                        <?php
    459459                    }
    460                
     460
    461461                    ?>
    462462
     
    478478                        <p id="wpTimeMachine_learn_about_formats" class="help" style="display:none">
    479479
    480                         By default File Formats is set to generate all of your archives as ZIP (.zip) files; since that seems to be the most commonly used archive format on most 
     480                        By default File Formats is set to generate all of your archives as ZIP (.zip) files; since that seems to be the most commonly used archive format on most
    481481                        operating systems (which means you probably already have the software needed to extract Zip files).  That said, tar files (or .tar.gz) provide better
    482                         compression and therefore take up less disk space and take less time to transfer. 
     482                        compression and therefore take up less disk space and take less time to transfer.
    483483
    484484                            <a href="javascript:;" onclick="jQuery(this).parent().hide()" class="close">Close</a>
    485485
    486486                        </p>
    487                    
     487
    488488                    </fieldset>
    489489
     
    509509
    510510                        This feature lets you take advantage of WordPress' ability to add events after a post gets published (or updated).  Using this plugin you
    511                         can force WordPress to start wp Time Machine every time a publish or update event occurs.  There is a considerable price worth thinking 
    512                         about: using this feature will add time to publishing (depending on the size of your blog it may add several seconds, or even minutes). 
    513                        
     511                        can force WordPress to start wp Time Machine every time a publish or update event occurs.  There is a considerable price worth thinking
     512                        about: using this feature will add time to publishing (depending on the size of your blog it may add several seconds, or even minutes).
     513
    514514                            <a href="javascript:;" onclick="jQuery(this).parent().hide()" class="close">Close</a>
    515515
     
    517517
    518518                    </fieldset>
    519                    
     519
    520520                    <fieldset>
    521521
     
    582582
    583583                        <?php
    584        
     584
    585585                            if ($wpTimeMachineOptionsStorage['use_log'] == "true") {
    586586                                echo '<a class="full" href="javascript:;" id="use_log" value="true">'.$wpTimeMachineText['use_log_labels'][0].'</a> &nbsp;&nbsp;';
     
    588588                                echo '<a class="full" href="javascript:;" id="use_log" value="false">'.$wpTimeMachineText['use_log_labels'][1].'</a> &nbsp;&nbsp;';
    589589                            }
    590                        
     590
    591591                            if ( file_exists( wpTimeMachineLog ) ) {
    592592                                echo '<a class="full" href="'. wpcontent_url .'/wpTimeMachine_log.txt" target="_blank">'.$wpTimeMachineText['view_log_label'].'</a> &nbsp;&nbsp;';
     
    618618
    619619            <div id="Info">
    620            
    621                 <p> 
    622                    
    623                     This plugin is pretty simple. You can use Dropbox, Amazon's S3, or an FTP account to store WordPress. Need an account? 
    624                     Visit: <a href="https://www.dropbox.com/" target="_new">Dropbox</a>. Or, for Amazon's S3 visit: 
    625                     <a href="https://s3.amazonaws.com/" target="_new">https://s3.amazonaws.com</a>.  If you decide to use an FTP account, 
     620
     621                <p>
     622
     623                    This plugin is pretty simple. You can use Dropbox, Amazon's S3, or an FTP account to store WordPress. Need an account?
     624                    Visit: <a href="https://www.dropbox.com/" target="_new">Dropbox</a>. Or, for Amazon's S3 visit:
     625                    <a href="https://s3.amazonaws.com/" target="_new">https://s3.amazonaws.com</a>.  If you decide to use an FTP account,
    626626                    it makes a lot of sense to use a remote FTP account on a server that isn't shared with this WordPress installation.
    627                                  
    628                 </p> 
    629                  
    630                 <p>   
    631                    
     627
     628                </p>
     629
     630                <p>
     631
    632632                    The files that get generated for each archive are:
    633                                          
     633
    634634                    <ol>
    635635                        <li>wpTimeMachine-content-files<?php echo $format; ?></li>
     
    638638                        <li>wpTimeMachine-Instructions.txt <sup>2</sup></li>
    639639                        <li>wpTimeMachine-RestorationScript.sh <sup>3</sup></li>
    640                     </ol> 
    641                                            
     640                    </ol>
     641
    642642                    <em>
    643643                    1: if you're not using .htaccess then no, it won't be created <br />
    644644                    2: if you're ever recovering from a catastrophic WordPress failure, this file will help<br />
    645645                    3: this file is still under development &amp; should be used with caution<br />
    646                     </em> 
    647                                          
     646                    </em>
     647
    648648                    <div class="hint">
    649649                    It's a good idea to store the following two items on your own, (in the same place as the files above):<br/>
     
    651651                    Or, read about how to use <a href="http://wptimemachine.com/-/wordpress-and-subversion/">Subversion for your WordPress implementation</a>.<br/>
    652652                    Your copy of wp-config.php <em>For security purposes this file is not backed up!</em>
    653                     </div> 
    654                      
    655                 </p> 
     653                    </div>
     654
     655                </p>
    656656
    657657                <p>
     
    663663                        <li><?php echo wpcontent_url . "/plugins/wp-time-machine/cron.php"; ?></li>
    664664                        <li><?php echo wpcontent_dir . "/plugins/wp-time-machine/cron.php"; ?></li>
    665                     </ol> 
    666                          
     665                    </ol>
     666
    667667                    For example, you might use curl:<br />
    668                                  
     668
    669669                    <code>
    670670                    curl "<?php echo wpcontent_url . "/plugins/wp-time-machine/cron.php"; ?>?generate=1"
    671671                    </code>
    672                  
     672
    673673                    <div class="hint">
    674                    
     674
    675675                    Note that it is recommended that you set up a separate cron job to delete the temporary archive files:
    676                            
     676
    677677                    <code>
    678678                    curl "<?php echo wpcontent_url . "/plugins/wp-time-machine/cron.php"; ?>?clean=1"
    679679                    </code>
    680                    
     680
    681681                    </div>
    682                    
     682
    683683                    There are many ways to use the scripts referenced above ... this is just an example, for more information read this:<br />
    684684                    <a href="http://wptimemachine.com/-/scheduling-wp-time-machine-via-cron/" target="_new">http://wptimemachine.com/-/scheduling-wp-time-machine-via-cron/</a>
    685                    
     685
    686686                </p>
    687687
    688688                <p>
    689689
    690                     Having trouble? Visit the <a href="http://wordpress.org/tags/wp-time-machine?forum_id=10" target="_blank">WordPress forum</a>, and please share 
    691                     this URL: <a href="<?php echo wpcontent_url . "/wpTimeMachine_log.txt"; ?>" target="_new"><?php echo wpcontent_url . "/wpTimeMachine_log.txt"; ?></a> 
     690                    Having trouble? Visit the <a href="http://wordpress.org/tags/wp-time-machine?forum_id=10" target="_blank">WordPress forum</a>, and please share
     691                    this URL: <a href="<?php echo wpcontent_url . "/wpTimeMachine_log.txt"; ?>" target="_new"><?php echo wpcontent_url . "/wpTimeMachine_log.txt"; ?></a>
    692692                    (the log -- if enabled -- contains vital information for trouble shooting).<br />
    693693
     
    697697
    698698            <div class="wpTimeMachine_footer">
    699            
    700                 <ul>               
     699
     700                <ul>
    701701                <li class="Twitter"><a href="http://twitter.com/home?status=An awesome WordPress plugin for backups: wp Time Machine: http://wpTimeMachine.com" target="_new">Share on Twitter</a></li>
    702702                <li class="Facebook"><a href="http://www.facebook.com/sharer.php?u=http://wpTimeMachine.com" target="_new">Share on Facebook</a></li>
    703703                <li class="Official"><a href="http://wpTimeMachine.com" target="_new" title="Official website for the wp Time Machine">wpTimeMachine.com</a>, version: <?php echo wpTimeMachineVersion; ?></li>
    704704                </ul>
    705            
     705
    706706            </div>
    707707
    708708        </p>
    709        
     709
    710710        <pre id="output" style="display:none">
    711711
     
    713713
    714714        if ($_GET['generate'] == 1) {
    715    
     715
    716716            // store start time & begin logging archive process
    717    
     717
    718718            $start_generate = time();
    719    
     719
    720720            wpTimeMachine_logger( $use_log,  '--- Start to generate archives...' );
    721            
     721
    722722            @unlink( wpcontent_archive.".tar.gz" );
    723723            @unlink( wpcontent_archive.".zip" );
    724    
     724
    725725            // validate referer via nonce
    726    
     726
    727727            check_admin_referer('wpTimeMachine_nonce');
    728    
     728
    729729            // instructions text file
    730730
     
    734734
    735735                include( "wpTimeMachineArchiveRestorationScript.php" );
    736            
     736
    737737            // generate archives
    738    
    739             if ($format == "zip") {   
    740                 $wpcontent_archive = new Archive_Zip( wpcontent_archive.$format );   
    741             } else {   
    742                 $wpcontent_archive = new Archive_Tar( wpcontent_archive.$format );   
     738
     739            if ($format == "zip") {
     740                $wpcontent_archive = new Archive_Zip( wpcontent_archive.$format );
     741            } else {
     742                $wpcontent_archive = new Archive_Tar( wpcontent_archive.$format );
    743743            }
    744            
    745             if ($wpTimeMachineOptionsStorage['exclude_cache'] == "true") {         
     744
     745            if ($wpTimeMachineOptionsStorage['exclude_cache'] == "true") {
    746746                $wpTimeMachine_excluded = array ( ".", "..", "upgrade", "cache" );
    747             } else {           
    748                 $wpTimeMachine_excluded = array ( ".", "..", "upgrade" );           
     747            } else {
     748                $wpTimeMachine_excluded = array ( ".", "..", "upgrade" );
    749749            }
    750            
     750
    751751            $wpTimeMachine_excluded[] = wpTimeMachineOptionsFile;
    752752
    753753            wpTimeMachine_logger( $use_log,  '---     wpTimeMachine-content-files' . $format . ', will contain: ' );
    754            
     754
    755755            $dh  = opendir(wpcontent_dir);
    756756            while (false !== ($filename = readdir($dh))) {
    757757                $wp_content_files[] = $filename;
    758758            }
    759            
    760             foreach ($wp_content_files as $wp_content_file) {           
    761                 if ( ! in_array( $wp_content_file, $wpTimeMachine_excluded ) ) {                   
    762                     $wpcontent_archive_files[] = wpcontent_dir . "/" .$wp_content_file;               
    763                     wpTimeMachine_logger( $use_log,  '---          add: wp-content/' . $wp_content_file );                   
    764                 }             
     759
     760            foreach ($wp_content_files as $wp_content_file) {
     761                if ( ! in_array( $wp_content_file, $wpTimeMachine_excluded ) ) {
     762                    $wpcontent_archive_files[] = wpcontent_dir . "/" .$wp_content_file;
     763                    wpTimeMachine_logger( $use_log,  '---          add: wp-content/' . $wp_content_file );
     764                }
    765765            }
    766766
    767767            if ($wpcontent_archive->create( $wpcontent_archive_files ) ) {
    768    
     768
    769769                @copy( $_SERVER['DOCUMENT_ROOT'] . "/.htaccess", htaccess_archive );
    770    
     770
    771771                wpTimeMachine_logger( $use_log,  '---     wpTimeMachine-htaccess.txt (copy of .htaccess file)' );
    772                
     772
    773773                $instructions_handle = fopen(instructions, 'w');
    774774                fwrite($instructions_handle, $instructions_txt);
    775775                fclose($instructions_handle);
    776    
     776
    777777                wpTimeMachine_logger( $use_log,  '---     wpTimeMachine-Instructions.txt (text instructions)' );
    778    
     778
    779779                $restoration_handle = fopen(restoration, 'w');
    780780                fwrite($restoration_handle, $restoration_shell_script);
    781781                fclose($restoration_handle);
    782    
     782
    783783                wpTimeMachine_logger( $use_log,  '---     wpTimeMachine-RestorationScript.sh (restoration shell script)' );
    784784
    785785                $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    786786                mysql_select_db(DB_NAME, $link);
    787    
     787
    788788                $tables = array();
    789789                $result = mysql_query("SHOW TABLES");
    790    
     790
    791791                while ($row = mysql_fetch_row($result)) {
    792792                    $tables[] = $row[0];
     
    795795                foreach ($tables as $table) {
    796796
    797                     $table_prefix = substr( $table, 0, strlen(wp_table_prefix) ); 
     797                    $table_prefix = substr( $table, 0, strlen(wp_table_prefix) );
    798798                    // if the current $table doesn't start with the wp table prefix skip it
    799                     if ($table_prefix == wp_table_prefix) {             
    800                    
     799                    if ($table_prefix == wp_table_prefix) {
     800
    801801                        $result = mysql_query('SELECT * FROM '.$table);
    802802                        $num_fields = mysql_num_fields($result);
    803        
     803
    804804                        $wpTimeMachine_dump.= 'DROP TABLE IF EXISTS '.$table.';';
    805805                        $row2 = mysql_fetch_row(mysql_query('SHOW CREATE TABLE '.$table));
    806806                        $wpTimeMachine_dump.= "\n\n".$row2[1].";\n\n";
    807        
     807
    808808                        for ($i = 0; $i < $num_fields; $i++) {
    809809                            while ($row = mysql_fetch_row($result)) {
     
    819819                        }
    820820                        $wpTimeMachine_dump.="\n\n\n";
    821                    
     821
    822822                    }
    823823
    824824                }
    825    
     825
    826826                $handle = fopen(wpdata_sql, 'w+');
    827827                fwrite($handle, $wpTimeMachine_dump);
     
    833833
    834834            // start processing the files
    835    
     835
    836836            wpTimeMachine_logger( $use_log,  '--- Initiate transfer to ' . $offsite );
    837837
     
    842842
    843843            $login_error = false;
    844                  
     844
    845845            switch ($offsite) {
    846846
    847847                case "dropbox":
    848                
     848
    849849                    $uploader = new DropboxUploader( $POST_remote_user, $POST_remote_pass );
    850                        
     850
    851851                    wpTimeMachine_logger( $use_log,  '--- Instantiate new DropboxUploader() ' );
    852852
     
    856856                        $dropbox_dir = "/" . $POST_remote_path ;
    857857                    }
    858                
     858
    859859                    if ($timestamp != "") {
    860860                        $dropbox_dir .= "-" . $timestamp;
    861                     } 
     861                    }
    862862
    863863                    foreach ($files as $i => $file) {
     
    867867
    868868                            try {
    869                            
     869
    870870                                $uploader->upload( $file, $remoteDir = $dropbox_dir );
    871871
     
    881881
    882882                        }
    883                     }   
     883                    }
    884884
    885885                    $remote_path = $dropbox_dir;
     
    889889                case "aws_s3":
    890890                case "s3":
    891                
     891
    892892                    if ($POST_remote_path == "") {
    893893                        $bucket = "wpTimeMachine";
     
    895895                        $bucket = $POST_remote_path ;
    896896                    }
    897                        
     897
    898898                    if ($timestamp != "") {
    899899                        $bucket .= "-" . $timestamp;
    900                     } 
    901                                
     900                    }
     901
    902902                    $bucket = uniqid( $bucket . "-" );
    903                    
     903
    904904                    $s3 = new S3( $POST_remote_user, $POST_remote_pass );
    905905
     
    907907
    908908                    try {
    909                    
     909
    910910                        $s3->putBucket( $bucket, S3::ACL_PRIVATE );
    911911
     
    919919
    920920                    }
    921                    
     921
    922922                    foreach ($files as $i => $file) {
    923                    
     923
    924924                        if (file_exists($file)) {
    925                        
     925
    926926                            wpTimeMachine_logger( $use_log,  '--- files loop: ' . $file . ' >> ' .  $bucket  . ' >> ' .  baseName( $file ) );
    927                        
     927
    928928                            $s3->putObjectFile( $file, $bucket, baseName( $file ), S3::ACL_PRIVATE );
    929                        
     929
    930930                        }
    931931
    932932                    }
    933                    
     933
    934934                    $remote_path = $bucket;
    935935
     
    939939
    940940                    include("wpTimeMachineNonSwitch.php4");
    941                    
     941
    942942                    break;
    943                    
     943
    944944                default:
    945                
    946                     wpTimeMachine_logger( $use_log,  '--- Error: no offsite set, or recognized.' ); 
     945
     946                    wpTimeMachine_logger( $use_log,  '--- Error: no offsite set, or recognized.' );
    947947
    948948            }
     
    950950
    951951            if (! $login_error) {
    952    
     952
    953953                wpTimeMachine_logger( $use_log,  '--- Transfer has completed, to remote_path: ' . $remote_path );
    954954
    955                 // store info about this archive   
     955                // store info about this archive
    956956                $wpTimeMachineOptionsStorage['recent_archive_path']     = $remote_path;
    957957                $wpTimeMachineOptionsStorage['recent_archive_format']   = $format;
    958                 $wpTimeMachineOptionsStorage['recent_archive_duration'] = time() - $wpTimeMachine_start;   
     958                $wpTimeMachineOptionsStorage['recent_archive_duration'] = time() - $wpTimeMachine_start;
    959959                update_option(adminOptionsName, $wpTimeMachineOptionsStorage);
    960        
     960
    961961                echo "<span id='update'>Your archives are ready, they took about " . $wpTimeMachineOptionsStorage['recent_archive_duration'] . " seconds to create;";
    962962                echo " and are in your ".$offsite_name." account (in this ".strtolower($remote_path_label).": ".$wpTimeMachineOptionsStorage['recent_archive_path'].").</span>";
    963        
     963
    964964            } else {
    965965
    966966                wpTimeMachine_logger( $use_log,  '--- Transfer not completed' );
    967        
     967
    968968                echo "<span id='update'>Archiving failed</span>";
    969        
     969
    970970            }
    971971
    972972        }
    973    
     973
    974974        ?>
    975975
     
    989989} // End function wpTimeMachine_init()
    990990
    991 function wpTimeMachine_publish_post($offsites) 
     991function wpTimeMachine_publish_post($offsites)
    992992{
    993993
     
    995995
    996996        shell_exec('curl "http://wptimemachine.com/_wp_/wp-content/plugins/wp-time-machine/cron.php?generate=1"');
    997        
     997
    998998        wpTimeMachine_logger( $use_log,  '--- wpTimeMachine_publish_post: success!' );
    999999
    10001000    } catch (Exception $e) {
    1001    
     1001
    10021002        $error = $e->getMessage();
    10031003        wpTimeMachine_logger( $use_log,  '--- wpTimeMachine_publish_post: Error: '.$error );
     
    10051005}
    10061006
    1007 function wpTimeMachine_enqueue_scripts() 
     1007function wpTimeMachine_enqueue_scripts()
    10081008{
    1009    
     1009
    10101010    wp_deregister_script( 'jquery-form' );
    10111011    wp_register_script( 'jquery-form', wpcontent_url . '/plugins/wp-time-machine/javascript/jquery.form.js' );
    10121012    wp_enqueue_script( 'jquery-form' );
    1013    
     1013
    10141014    wp_register_script( 'jquery.validate', wpcontent_url . '/plugins/wp-time-machine/javascript/jquery.validate.js' );
    10151015    wp_enqueue_script( 'jquery.validate' );
    1016    
     1016
    10171017    wp_register_script( 'jquery.simplemodal-1.3.5.min', wpcontent_url . '/plugins/wp-time-machine/javascript/jquery.simplemodal-1.3.5.min.js' );
    10181018    wp_enqueue_script( 'jquery.simplemodal-1.3.5.min' );
    10191019
    1020 }   
     1020}
    10211021
    10221022function wpTimeMachine_head()
    1023 { 
    1024    
     1023{
     1024
    10251025    echo '<link type="text/css" rel="stylesheet" href="' . wpcontent_url . '/plugins/wp-time-machine/css/wp-time-machine.css" />' . "\n";
    10261026
     
    10311031
    10321032    if ($use_log != "true") return;
    1033    
     1033
    10341034    if (wpTimeMachine_apache_log == "true") error_log( $message );
    10351035
     
    10501050        @unlink( $file );
    10511051    }
    1052    
     1052
    10531053    // the only file that is $format specific is the wp-content archive
    1054     // ...so we need to ensure that either format gets deleted 
     1054    // ...so we need to ensure that either format gets deleted
    10551055    @unlink( wpcontent_archive.".tar.gz" );
    10561056    @unlink( wpcontent_archive.".zip" );
     
    10641064
    10651065    $wpTimeMachineOptionsStorage = get_option(adminOptionsName);
    1066    
     1066
    10671067    $option_dump  = "";
    10681068
     
    10801080        foreach ($wpTimeMachineOptionsStorage as $key => $option) {
    10811081            $wpTimeMachineOptions[$key] = $option;
    1082            
     1082
    10831083            $option_dump .= "$"."wpTimeMachineOptionsStorage['" . $key . "'] = \"" . $option . "\";" . "\n";
    1084            
     1084
    10851085        }
    10861086    }
     
    10931093    fwrite($od_handle, $option_dump);
    10941094    fclose($od_handle);
    1095    
     1095
    10961096    return $wpTimeMachineOptions;
    10971097
     
    11231123// Hook to kick off wp Time Machine after publish event hook fires
    11241124
    1125 function wpTimeMachine_post_pub($offsites) 
     1125function wpTimeMachine_post_pub($offsites)
    11261126{
    11271127
    11281128    $wpTimeMachineOptionsStorage = wpTimeMachine_getAdminOptions();
    1129    
     1129
    11301130    if ($wpTimeMachineOptionsStorage['use_post_pub'] == "false") {
    11311131        return;
     
    11351135
    11361136        shell_exec('curl "http://wptimemachine.com/_wp_/wp-content/plugins/wp-time-machine/cron.php?generate=1"');
    1137        
     1137
    11381138        wpTimeMachine_logger( $use_log,  '--- wpTimeMachine_post_pub: success!' );
    11391139
    11401140    } catch (Exception $e) {
    1141    
     1141
    11421142        $error = $e->getMessage();
    1143        
     1143
    11441144        wpTimeMachine_logger( $use_log,  '--- wpTimeMachine_post_pub: Error: '.$error );
    1145        
     1145
    11461146    }
    11471147}
Note: See TracChangeset for help on using the changeset viewer.