Plugin Directory

Changeset 3470185


Ignore:
Timestamp:
02/26/2026 11:04:17 AM (4 weeks ago)
Author:
softaculous
Message:

New version

Location:
backuply/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • backuply/trunk/assets/css/styles.css

    r3026806 r3470185  
    805805border:1px solid #d9d9d9;
    806806}
     807
     808/* Pagination CSS*/
     809.backuply-tablenav{
     810height: 30px;
     811margin: 6px 0 4px;
     812padding-top: 5px;
     813}
     814
     815#backuply-pagination{
     816display: flex;
     817justify-content: space-between;
     818align-items: center;
     819padding: 10px 0;
     820}
     821
     822.backuply-pagination-links{
     823display:flex;
     824align-items:center;
     825gap:10px;
     826}
     827
     828a.button.backuply-prev-page,
     829a.button.backuply-next-page,
     830a.button.backuply-prev-first-page,
     831a.button.backuply-last-next-page{
     832background-color: #2271b1;
     833color: #fff;
     834}
     835
     836.backuply-total-items,
     837.backuply-pagination-info,
     838.backuply-pagination-input{
     839font-weight: 600;
     840color:#555 ;
     841}
     842
     843/* Input box */
     844.backuply-pagination-input input{
     845padding: 0px;
     846text-align: center;
     847}
  • backuply/trunk/assets/js/backuply.js

    r3395599 r3470185  
    423423        }
    424424    });
    425 }); 
     425});
    426426
    427427// Handles Dashboard Tabs
     
    11811181                    retry_time_seconds = 5000;
    11821182                }
    1183        
    1184         console.log('Attempting Retry');
     1183
    11851184                setTimeout(backuply_backup_progress, retry_time_seconds);   
    11861185            }
  • backuply/trunk/backup_ins.php

    r3395599 r3470185  
    220220   
    221221    backuply_backup_stop_checkpoint();
     222
     223    // Close the connection
     224    if(!empty($link)){
     225        backuply_mysql_close($link);
     226        $link = null;
     227    }
     228
    222229    // Just check that file is created or not ??
    223230    if(file_exists($sdbfile)){
     
    10811088}
    10821089
     1090// Close mysql connection
     1091function backuply_mysql_close($conn){
     1092    if(empty($conn)){
     1093        return true;
     1094    }
     1095
     1096    if(extension_loaded('mysqli')){
     1097        @mysqli_close($conn);
     1098    } else {
     1099        @mysql_close($conn);
     1100    }
     1101
     1102    return true;
     1103}
     1104
    10831105function backuply_getFieldsMeta($result){
    10841106    // Build an associative array for a type look up
     
    15711593
    15721594    $url = site_url() . '/?action='.$action.'&security='. $nonce;
     1595
     1596    // Cloudflare was returning cached HIT on this request making the request to fail
     1597    // So we will be adding a cache buster to prevent cached version of the endpoint.
     1598    if(isset($_SERVER['HTTP_CF_RAY'])){
     1599        $url .= '&cachebuster='.time();
     1600    }
    15731601   
    15741602    backuply_status_log('About to call self to prevent timeout', 'info');
     
    17671795
    17681796//Create the filename
    1769 $server_name = !empty($_SERVER['SERVER_NAME']) ? wp_kses_post(wp_unslash($_SERVER['SERVER_NAME'])) : '';
     1797$server_name = !empty($_SERVER['SERVER_NAME']) ? backuply_sanitize_filename(wp_unslash($_SERVER['SERVER_NAME'])) : '';
    17701798$data['name'] =  !isset($backuply['status']['name']) ? (defined('SITEPAD') ? 'sp_' : 'wp_').$server_name.'_'.date('Y-m-d_H-i-s') : $backuply['status']['name'];
    17711799
     
    19531981    $backuply['status']['backup_db_done'] = 1;
    19541982    backuply_status_log('Creation of SQL dump completed', 'working', 24);
     1983
     1984    // Close the mysql connection opened, creating for dump
     1985    if(!empty($sql_conn)){
     1986        backuply_mysql_close($sql_conn);
     1987        $sql_conn = null;
     1988    }
    19551989}
    19561990
  • backuply/trunk/backuply.php

    r3395599 r3470185  
    44Plugin URI: http://wordpress.org/plugins/backuply/
    55Description: Backuply is a Wordpress Backup plugin. Backups are the best form of security and safety a website can have.
    6 Version: 1.5.1
     6Version: 1.5.2
    77Author: Softaculous
    88Author URI: https://backuply.com
  • backuply/trunk/functions.php

    r3370522 r3470185  
    833833}
    834834
    835 function backuply_get_backups_info(){
    836    
     835/**
     836 * Gets a list of backups along with their info data.
     837 *
     838 * @param int $offset Starting offset (must be >= 0).
     839 * @param int $limit  Maximum number of backups to return.
     840 *                    Use -1 for no limit (default).
     841 *
     842 * @return array List of backups with associated info data.
     843 */
     844function backuply_get_backups_info_data($offset = 0, $limit = -1){
     845
    837846    // Get all Backups Information from the "backups_info" folder.
    838847    $all_backup_info_files = backuply_glob('backups_info');
    839848    $backup_files_location = backuply_glob('backups');
    840849   
    841     $backup_infos = array();
     850    $backup_infos = [];
    842851
    843852    if(empty($all_backup_info_files)){
    844         return [];
    845     }
    846 
     853        return $backup_infos;
     854    }
     855
     856    // Not using glob becasue it is 10 times slower than scandir
     857    //$info_files = glob($all_backup_info_files .'/*[0-9].php');
    847858    $info_files = @scandir($all_backup_info_files);
    848    
     859
    849860    if(empty($info_files)){
    850861        return $backup_infos;
    851862    }
    852863   
     864    $info_files = array_diff($info_files, ['.', '..', 'index.php', 'index.html', 'debug.php']);
     865
     866    // Sorting the files based on the time in the file name.
     867    rsort($info_files, SORT_STRING);
     868
    853869    foreach($info_files as $files){
    854 
    855         if($files != '.' && $files != '..'){
     870       
     871        if($limit == 0){
     872            break;
     873        }
     874       
     875        if($offset > 0){
     876            $offset--;
     877            continue;
     878        }
     879
     880        $check_for_file = basename($files, '.php');
     881
     882        $file = file($all_backup_info_files.'/'.$files);
     883        unset($file[0]);
     884        $all_info = json_decode(implode('', $file));
     885
     886        $backup_file_location = $backup_files_location.'/'.$check_for_file.'.tar.gz';
     887        if(file_exists($backup_file_location) || isset($all_info->backup_location)){
     888
     889            //Store all the files information in an array
     890            $backup_infos[] = $all_info;
    856891           
    857             $i = 0;
    858             $check_for_file = basename($files, '.php');
    859 
    860             $file = file($all_backup_info_files."/".$files);
    861             unset($file[0]);
    862             $all_info = json_decode(implode('', $file));
    863 
    864             $backup_file_location = $backup_files_location.'/'.$check_for_file.'.tar.gz';
    865             if(file_exists($backup_file_location) || isset($all_info->backup_location)){
    866 
    867                 //Store all the files information in an array
    868                 $backup_infos[] = $all_info;
     892            if($limit > 0){
     893                $limit--;
    869894            }
    870895        }
    871896    }
    872897
    873     return $backup_infos;
     898    // Count to calculate pages for pagination, and can be done here only.
     899    $backups_info = [
     900        'total_backups' => count($info_files),
     901        'backup_infos' => $backup_infos
     902    ];
     903
     904    return $backups_info;
     905}
     906
     907// This is just a wrapper to backuply_get_backups_info_data
     908// So that we do not have to change the function call on other places
     909function backuply_get_backups_info(){
     910    $infos = backuply_get_backups_info_data();
     911   
     912    if(empty($infos) || empty($infos['backup_infos'])){
     913        return [];
     914    }
     915   
     916    return $infos['backup_infos'];
    874917}
    875918
  • backuply/trunk/init.php

    r3395599 r3470185  
    1111}
    1212
    13 define('BACKUPLY_VERSION', '1.5.1');
     13define('BACKUPLY_VERSION', '1.5.2');
    1414define('BACKUPLY_DIR', dirname(BACKUPLY_FILE));
    1515define('BACKUPLY_URL', plugins_url('', BACKUPLY_FILE));
  • backuply/trunk/main/license.php

    r3237989 r3470185  
    1212
    1313    check_admin_referer('backuply_license_form', 'backuply_license_nonce');
     14   
     15    if(!empty($_POST['delete_backuply_license'])){
     16        delete_option('backuply_license');
     17        $backuply['license'] = [];
     18        add_settings_error('backuply-notice', esc_attr('settings_updated'), esc_html__('The license has been deleted successfully.', 'backuply'), 'success');
     19        return;
     20    }
    1421   
    1522    $license = sanitize_key(backuply_optpost('backuply_license'));
     
    6269    global $backuply;
    6370   
    64     if(!empty($_POST['save_backuply_license'])) {
     71    if(!empty($_POST['save_backuply_license']) || !empty($_POST['delete_backuply_license'])){
    6572        backuply_license();
    6673    }
     
    93100                            <?php wp_nonce_field( 'backuply_license_form','backuply_license_nonce' ); ?>
    94101                            <input name="save_backuply_license" class="button button-primary" value="Update License" type="submit">
     102                           
     103                            <?php
     104                            if(!empty($backuply['license']) && !empty($backuply['license']['license']) && strpos($backuply['license']['license'], 'BAKLY') === 0){
     105                                echo '<input name="delete_backuply_license" class="button" value="'.esc_html__('Delete License', 'backuply').'" type="submit">';
     106                            }
     107                            ?>
    95108                        </form>
    96                         <?php if(!empty($backuply['license']) && !empty($backuply['license']['expires'])){
     109                        <?php
     110                        if(!empty($backuply['license']) && !empty($backuply['license']['expires'])){
    97111
    98112                            $expires = $backuply['license']['expires'];
     
    110124                            echo '<div style="margin-top:3px;">Cloud Storage: '.size_format(esc_html($backuply['license']['quota'])).'</div>';
    111125                        }
     126                       
     127                        if(defined('BACKUPLY_PRO') && !empty($backuply['license']['plan']) && $backuply['license']['plan'] == 'bcloud' && !empty($backuply['license']['active'])){
     128                            $soft_wp_lic = get_option('softaculous_pro_license', []);
     129                           
     130                            if(!empty($soft_wp_lic['license']) && !empty($soft_wp_lic['active'])){
     131                                echo '<div><span class="dashicons dashicons-info"></span>'.esc_html__('The Pro version will be updated using', 'backuply').' <strong><em>'.esc_html($soft_wp_lic['license']).'</em></strong></div>';
     132                            }
     133                        }
    112134
    113135                        ?>
     
    116138
    117139                <tr>
    118                     <th align="left" valign="top">Backuply Cloud</th>
     140                    <th align="left" valign="top">Backuply Cloud Key</th>
    119141                    <?php
    120142
     
    127149                                    '.wp_nonce_field('backuply_cloud_form', 'backuply_cloud_nonce').'
    128150                                    <input name="save_backuply_cloud_key" class="button button-primary" value="Update Cloud Key" type="submit">
    129                                     <p class="description">'.__('Backuply Cloud Key works in combination with Backuply License which you get when you buy a plan', 'backuply').'<br>'.__('The key is generated automatically, when you add Backuply Cloud location to a new site, for more info read this', 'backuply').' <a href="https://backuply.com/docs/backuply-cloud/how-to-get-backuply-cloud-key/#lost-backuply-clou-key" target="_blank">docs</a></p>
     151                                    <p class="description">'.__('Backuply Cloud requires both a Backuply License and a Cloud Key.', 'backuply').'<br>'.__('The license comes with your plan, and the Cloud Key is automatically generated when you add a Backuply Cloud location for the first time on a site.', 'backuply').'<br/>
     152                                    '.__('For more details, please refer to the', 'backuply').'&nbsp;<a href="https://backuply.com/docs/backuply-cloud/how-to-get-backuply-cloud-key/" target="_blank">'.__('documentation', 'backuply').'</a></p>
    130153                                </label>
    131154                            </form>
  • backuply/trunk/main/settings.php

    r3363283 r3470185  
    100100   
    101101    <?php
    102     if(empty($backuply['bcloud_key'])){
     102    // The promo should be only visible to Free versions and SOFTWP license users
     103    if(
     104        empty($backuply['license']) ||
     105        (!empty($backuply['license']['license']) && strpos($backuply['license']['license'], 'BAKLY') !== 0)
     106    ){
    103107        echo '<div class="backuply-promotion-content backuply-cloud-banner" style="background-color:#000;">
    104108            <div class="backuply-cloud-gtext"><div>Backuply</div> <div>Cloud</div></div>
     
    18201824        <div class="inside">
    18211825            <div class="backuply-settings-block">
    1822                 <table class="table" style="width:100%;">
     1826                <table class="table" style="width:100%;" id="backuply-history-table">
    18231827                    <thead>
    18241828                        <tr>
     
    18361840                    <tbody>
    18371841                    <?php
    1838                     $backup_infos = backuply_get_backups_info();
    1839 
    1840                     foreach($backup_infos as $count => $all_info){
     1842                    $history_page = !empty($_GET['history_page']) ? (int)$_GET['history_page'] : 0;
     1843                    $backups_per_page = 20;
     1844                    $history_offset = ($history_page - 1)*$backups_per_page;
     1845                   
     1846                    $backup_infos = backuply_get_backups_info_data($history_offset, $backups_per_page);
     1847
     1848                    foreach($backup_infos['backup_infos'] as $count => $all_info){
    18411849                        $backup_loc_name = 'Local';
    18421850                        $backup_protocol = 'local';
     
    19531961                </table>
    19541962            </div>
     1963           
     1964            <?php
     1965            $page_count = ceil($backup_infos['total_backups']/$backups_per_page);
     1966           
     1967            if(!empty($page_count) && $page_count > 1){
     1968            ?>
     1969            <div class="backuply-tablenav">
     1970                <div class="backuply-tablenav-pages" id="backuply-pagination">
     1971                    <div class="backuply-total-items">Total Backups: <?php echo esc_html($backup_infos['total_backups']);?></div>
     1972                    <div class="backuply-pagination-controls">
     1973                    <?php
     1974                        if(empty($history_page) || $history_page < 1){
     1975                            $history_page = 1;
     1976                        } else if($history_page > $page_count){
     1977                            $history_page = $page_count;
     1978                        }
     1979
     1980                        echo '<div class="backuply-pagination-links">
     1981                            <div class="backuply-pagination-links">
     1982                                <a class="button backuply-prev-first-page" '.($history_page  <= 1 ? 'disabled' : 'href="'.esc_url(admin_url('?page=backuply#backuply-history')).'"').'>‹‹</a>
     1983                               
     1984                                <a class="button backuply-prev-page" '.($history_page <= 1 ? 'disabled' : 'href="'.esc_url(admin_url('?page=backuply&history_page='.($history_page-1).'#backuply-history')).'"').'>‹</a>
     1985                                <span class="backuply-pagination-info"> Page '.esc_html($history_page).' of '.esc_html($page_count).' </span>
     1986                                <a class="button backuply-next-page" '.(($page_count <= 1 || $history_page == $page_count) ? 'disabled' : 'href="'.esc_url(admin_url('?page=backuply&history_page='.($history_page+1).'#backuply-history')).'"').'>›</a>
     1987                                <a class="button backuply-last-next-page" '.(($page_count <= 1 || $history_page == $page_count) ? 'disabled' : 'href="'.esc_url(admin_url('?page=backuply&history_page='.($page_count).'#backuply-history')).'"').'>››</a>
     1988                                <form method="GET" action="'.esc_url(admin_url('?page=backuply#backuply-history')).'">
     1989                                <input type="hidden" value="backuply" name="page"/>
     1990                                <span class="backuply-pagination-input">Go to <input type="number" name="history_page" min="1" max="'.esc_attr($page_count).'" value="'.esc_attr($history_page).'"> Page</span>
     1991                                </form>
     1992                                </div></div>';
     1993                    ?>
     1994                    </div>
     1995                </div>
     1996            </div>
     1997            <?php } ?>
    19551998        </div>
    19561999    </div>
  • backuply/trunk/readme.txt

    r3395599 r3470185  
    55Tested up to: 6.9
    66Requires PHP: 5.5
    7 Stable tag: 1.5.1
     7Stable tag: 1.5.2
    88License: LGPL v2.1
    99License URI: http://www.gnu.org/licenses/lgpl-2.1.html
     
    8686== Changelog ==
    8787
     88= 1.5.2 (26th February 2026) =
     89* [Improvement] Backup history is now sorted based on time, with recent backups at the top.
     90* [Improvement] Backup history now includes pagination, displaying 20 backups per page.
     91* [Bug-Fix] On backup database connection was not closing after usage, which cause issue for a user, this has been fixed.
     92* [Task] .htaccess file has been excluded from restoration, it causes issue if environment of the server changes.
     93* [Task] Adding Cache burst in case where backup requests were hitting Cloudflare cache.
     94
    8895= 1.5.1 (14th November 2025) =
    8996* [Bug-Fix] Backups could get stuck when certain special characters were present in file names.
  • backuply/trunk/restore_ins.php

    r3355380 r3470185  
    16221622
    16231623                        }else{
    1624                             // We will not restore the root htaccess file if the user is migrating to prevent issues related to difference in environment on the new server.
    1625                             if(!empty($data['is_migrating']) && $v_header['filename'] == $data['softpath'] .'/'. '.htaccess'){
     1624                            // We will not restore the root htaccess file to prevent issues related to difference in environment
     1625                            // It was causing issue for users who either migrate to new server or if the user has changed their environment
     1626                            // since the backup they are restoring, and issue in htaccess causes issue with restoring site properly
     1627                            if($v_header['filename'] == $data['softpath'] .'/'. '.htaccess'){
    16261628                                $v_header['filename'] .=  '.backuply';
    16271629                            }
Note: See TracChangeset for help on using the changeset viewer.