Changeset 3470185
- Timestamp:
- 02/26/2026 11:04:17 AM (4 weeks ago)
- Location:
- backuply/trunk
- Files:
-
- 10 edited
-
assets/css/styles.css (modified) (1 diff)
-
assets/js/backuply.js (modified) (2 diffs)
-
backup_ins.php (modified) (5 diffs)
-
backuply.php (modified) (1 diff)
-
functions.php (modified) (1 diff)
-
init.php (modified) (1 diff)
-
main/license.php (modified) (6 diffs)
-
main/settings.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
restore_ins.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
backuply/trunk/assets/css/styles.css
r3026806 r3470185 805 805 border:1px solid #d9d9d9; 806 806 } 807 808 /* Pagination CSS*/ 809 .backuply-tablenav{ 810 height: 30px; 811 margin: 6px 0 4px; 812 padding-top: 5px; 813 } 814 815 #backuply-pagination{ 816 display: flex; 817 justify-content: space-between; 818 align-items: center; 819 padding: 10px 0; 820 } 821 822 .backuply-pagination-links{ 823 display:flex; 824 align-items:center; 825 gap:10px; 826 } 827 828 a.button.backuply-prev-page, 829 a.button.backuply-next-page, 830 a.button.backuply-prev-first-page, 831 a.button.backuply-last-next-page{ 832 background-color: #2271b1; 833 color: #fff; 834 } 835 836 .backuply-total-items, 837 .backuply-pagination-info, 838 .backuply-pagination-input{ 839 font-weight: 600; 840 color:#555 ; 841 } 842 843 /* Input box */ 844 .backuply-pagination-input input{ 845 padding: 0px; 846 text-align: center; 847 } -
backuply/trunk/assets/js/backuply.js
r3395599 r3470185 423 423 } 424 424 }); 425 }); 425 }); 426 426 427 427 // Handles Dashboard Tabs … … 1181 1181 retry_time_seconds = 5000; 1182 1182 } 1183 1184 console.log('Attempting Retry'); 1183 1185 1184 setTimeout(backuply_backup_progress, retry_time_seconds); 1186 1185 } -
backuply/trunk/backup_ins.php
r3395599 r3470185 220 220 221 221 backuply_backup_stop_checkpoint(); 222 223 // Close the connection 224 if(!empty($link)){ 225 backuply_mysql_close($link); 226 $link = null; 227 } 228 222 229 // Just check that file is created or not ?? 223 230 if(file_exists($sdbfile)){ … … 1081 1088 } 1082 1089 1090 // Close mysql connection 1091 function 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 1083 1105 function backuply_getFieldsMeta($result){ 1084 1106 // Build an associative array for a type look up … … 1571 1593 1572 1594 $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 } 1573 1601 1574 1602 backuply_status_log('About to call self to prevent timeout', 'info'); … … 1767 1795 1768 1796 //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'])) : ''; 1770 1798 $data['name'] = !isset($backuply['status']['name']) ? (defined('SITEPAD') ? 'sp_' : 'wp_').$server_name.'_'.date('Y-m-d_H-i-s') : $backuply['status']['name']; 1771 1799 … … 1953 1981 $backuply['status']['backup_db_done'] = 1; 1954 1982 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 } 1955 1989 } 1956 1990 -
backuply/trunk/backuply.php
r3395599 r3470185 4 4 Plugin URI: http://wordpress.org/plugins/backuply/ 5 5 Description: Backuply is a Wordpress Backup plugin. Backups are the best form of security and safety a website can have. 6 Version: 1.5. 16 Version: 1.5.2 7 7 Author: Softaculous 8 8 Author URI: https://backuply.com -
backuply/trunk/functions.php
r3370522 r3470185 833 833 } 834 834 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 */ 844 function backuply_get_backups_info_data($offset = 0, $limit = -1){ 845 837 846 // Get all Backups Information from the "backups_info" folder. 838 847 $all_backup_info_files = backuply_glob('backups_info'); 839 848 $backup_files_location = backuply_glob('backups'); 840 849 841 $backup_infos = array();850 $backup_infos = []; 842 851 843 852 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'); 847 858 $info_files = @scandir($all_backup_info_files); 848 859 849 860 if(empty($info_files)){ 850 861 return $backup_infos; 851 862 } 852 863 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 853 869 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; 856 891 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--; 869 894 } 870 895 } 871 896 } 872 897 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 909 function 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']; 874 917 } 875 918 -
backuply/trunk/init.php
r3395599 r3470185 11 11 } 12 12 13 define('BACKUPLY_VERSION', '1.5. 1');13 define('BACKUPLY_VERSION', '1.5.2'); 14 14 define('BACKUPLY_DIR', dirname(BACKUPLY_FILE)); 15 15 define('BACKUPLY_URL', plugins_url('', BACKUPLY_FILE)); -
backuply/trunk/main/license.php
r3237989 r3470185 12 12 13 13 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 } 14 21 15 22 $license = sanitize_key(backuply_optpost('backuply_license')); … … 62 69 global $backuply; 63 70 64 if(!empty($_POST['save_backuply_license']) ){71 if(!empty($_POST['save_backuply_license']) || !empty($_POST['delete_backuply_license'])){ 65 72 backuply_license(); 66 73 } … … 93 100 <?php wp_nonce_field( 'backuply_license_form','backuply_license_nonce' ); ?> 94 101 <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 ?> 95 108 </form> 96 <?php if(!empty($backuply['license']) && !empty($backuply['license']['expires'])){ 109 <?php 110 if(!empty($backuply['license']) && !empty($backuply['license']['expires'])){ 97 111 98 112 $expires = $backuply['license']['expires']; … … 110 124 echo '<div style="margin-top:3px;">Cloud Storage: '.size_format(esc_html($backuply['license']['quota'])).'</div>'; 111 125 } 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 } 112 134 113 135 ?> … … 116 138 117 139 <tr> 118 <th align="left" valign="top">Backuply Cloud </th>140 <th align="left" valign="top">Backuply Cloud Key</th> 119 141 <?php 120 142 … … 127 149 '.wp_nonce_field('backuply_cloud_form', 'backuply_cloud_nonce').' 128 150 <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').' <a href="https://backuply.com/docs/backuply-cloud/how-to-get-backuply-cloud-key/" target="_blank">'.__('documentation', 'backuply').'</a></p> 130 153 </label> 131 154 </form> -
backuply/trunk/main/settings.php
r3363283 r3470185 100 100 101 101 <?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 ){ 103 107 echo '<div class="backuply-promotion-content backuply-cloud-banner" style="background-color:#000;"> 104 108 <div class="backuply-cloud-gtext"><div>Backuply</div> <div>Cloud</div></div> … … 1820 1824 <div class="inside"> 1821 1825 <div class="backuply-settings-block"> 1822 <table class="table" style="width:100%;" >1826 <table class="table" style="width:100%;" id="backuply-history-table"> 1823 1827 <thead> 1824 1828 <tr> … … 1836 1840 <tbody> 1837 1841 <?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){ 1841 1849 $backup_loc_name = 'Local'; 1842 1850 $backup_protocol = 'local'; … … 1953 1961 </table> 1954 1962 </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 } ?> 1955 1998 </div> 1956 1999 </div> -
backuply/trunk/readme.txt
r3395599 r3470185 5 5 Tested up to: 6.9 6 6 Requires PHP: 5.5 7 Stable tag: 1.5. 17 Stable tag: 1.5.2 8 8 License: LGPL v2.1 9 9 License URI: http://www.gnu.org/licenses/lgpl-2.1.html … … 86 86 == Changelog == 87 87 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 88 95 = 1.5.1 (14th November 2025) = 89 96 * [Bug-Fix] Backups could get stuck when certain special characters were present in file names. -
backuply/trunk/restore_ins.php
r3355380 r3470185 1622 1622 1623 1623 }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'){ 1626 1628 $v_header['filename'] .= '.backuply'; 1627 1629 }
Note: See TracChangeset
for help on using the changeset viewer.