| @@ -1,10 +1,10 @@ | ||
| 1 | -<?php | |
| 1 | +<?php // phpcs:ignore | |
| 2 | 2 | /** |
| 3 | - * Plugin Name: WP Database Backup - Unlimited Database & Files Backup by Backup for WP | |
| 4 | - * Plugin URI: https://wordpress.org/plugins/wp-database-backup | |
| 3 | + * Plugin Name: Backup For WP | |
| 4 | + * Plugin URI:https://wordpress.org/plugins/wp-database-backup | |
| 5 | 5 | * Description: This plugin helps you to create/restore Unlimited WordPress Database & Files backup. |
| 6 | - * Version: 7.13 | |
| 6 | + * Version: 6.7 | |
| 7 | 7 | * Author: Backup for WP |
| 8 | 8 | * Author URI: https://backupforwp.com/ |
| 9 | 9 | * Text Domain: wpdbbkp |
| 10 | 10 | * Domain Path: /lang |
| @@ -10,9 +10,9 @@ | ||
| 10 | 10 | * Domain Path: /lang |
| 11 | 11 | * |
| 12 | 12 | * This plugin helps you to create Database Backup easily. |
| 13 | 13 | * |
| 14 | - * License: GPL v2 | |
| 14 | + * License: GPL v3 | |
| 15 | 15 | * |
| 16 | 16 | * This program is free software: you can redistribute it and/or modify |
| 17 | 17 | * it under the terms of the GNU General Public License as published by |
| 18 | 18 | * the Free Software Foundation, either version 3 of the License, or |
| @@ -37,9 +37,9 @@ | ||
| 37 | 37 | * Main WPDatabaseBackup Class. |
| 38 | 38 | * |
| 39 | 39 | * @class WPDatabaseBackup |
| 40 | 40 | * |
| 41 | - * @version 7.11 | |
| 41 | + * @version 1.1 | |
| 42 | 42 | */ |
| 43 | 43 | final class WPDatabaseBackup { |
| 44 | 44 | |
| 45 | 45 | /** |
| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | * Plugin version |
| 47 | 47 | * |
| 48 | 48 | * @var string |
| 49 | 49 | */ |
| 50 | - public $version = '7.13'; | |
| 50 | + public $version = '6.7'; | |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Plugin instance |
| 54 | 54 | * |
| @@ -106,84 +106,37 @@ | ||
| 106 | 106 | define( 'WPDB_BACKUPS_DIR','db-backup'); |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - /** | |
| 111 | - * Include Requred files and lib. | |
| 112 | - */ | |
| 113 | - private function includes() | |
| 114 | - { | |
| 115 | - // Ensure WPDB_PATH is defined - if not, define it now | |
| 116 | - if ( ! defined( 'WPDB_PATH' ) ) { | |
| 117 | - define( 'WPDB_PATH', plugin_dir_path( __FILE__ ) ); | |
| 110 | + /** | |
| 111 | + * Include Requred files and lib. | |
| 112 | + */ | |
| 113 | + private function includes() { | |
| 114 | + include_once 'includes/admin/mb-helper-functions.php'; | |
| 115 | + include_once 'includes/admin/class-wpdb-admin.php'; | |
| 116 | + include_once 'includes/admin/Destination/wp-backup-destination-upload-action.php'; | |
| 117 | + include_once 'includes/class-wpdbbackuplog.php'; | |
| 118 | + include_once 'includes/admin/filter.php'; | |
| 119 | + include_once 'includes/admin/newsletter.php'; | |
| 120 | + include_once 'includes/admin/cron-create-full-backup.php'; | |
| 121 | + include_once 'includes/log_generate.php'; | |
| 122 | + | |
| 118 | 123 | } |
| 119 | - | |
| 120 | - // Use plugin_dir_path directly to ensure we always have a valid absolute path | |
| 121 | - // This prevents issues if WPDB_PATH constant is empty or not set correctly | |
| 122 | - $plugin_path = plugin_dir_path( __FILE__ ); | |
| 123 | - | |
| 124 | - $admin_path = $plugin_path . 'includes/admin/'; | |
| 125 | - $includes_path = $plugin_path . 'includes/'; | |
| 126 | - | |
| 127 | - if ( file_exists( $admin_path . 'mb-helper-functions.php' ) ) { | |
| 128 | - include_once $admin_path . 'mb-helper-functions.php'; | |
| 129 | - } | |
| 130 | - if ( file_exists( $admin_path . 'class-wpdb-admin.php' ) ) { | |
| 131 | - include_once $admin_path . 'class-wpdb-admin.php'; | |
| 132 | - } | |
| 133 | - if ( file_exists( $admin_path . 'Destination/wp-backup-destination-upload-action.php' ) ) { | |
| 134 | - include_once $admin_path . 'Destination/wp-backup-destination-upload-action.php'; | |
| 135 | - } | |
| 136 | - if ( file_exists( $includes_path . 'class-wpdbbackuplog.php' ) ) { | |
| 137 | - include_once $includes_path . 'class-wpdbbackuplog.php'; | |
| 138 | - } | |
| 139 | - if ( file_exists( $admin_path . 'filter.php' ) ) { | |
| 140 | - include_once $admin_path . 'filter.php'; | |
| 141 | - } | |
| 142 | - if ( file_exists( $admin_path . 'class-wpdbbkp-newsletter.php' ) ) { | |
| 143 | - include_once $admin_path . 'class-wpdbbkp-newsletter.php'; | |
| 144 | - } | |
| 145 | - if ( file_exists( $includes_path . 'features.php' ) ) { | |
| 146 | - include_once $includes_path . 'features.php'; | |
| 147 | - } | |
| 148 | - $wp_db_incremental_backup = get_option('wp_db_incremental_backup'); | |
| 149 | - $wpdb_clouddrive_cd = get_option('wpdb_clouddrive_token', false); | |
| 150 | - $wp_db_backup_destination_bb = get_option('wp_db_backup_destination_bb', false); | |
| 151 | - if (($wp_db_incremental_backup == 1 && $wp_db_backup_destination_bb ==1 )|| ($wpdb_clouddrive_cd && !empty($wpdb_clouddrive_cd))) { | |
| 152 | - if ( file_exists( $admin_path . 'cron-create-full-backup-incremental.php' ) ) { | |
| 153 | - include_once $admin_path . 'cron-create-full-backup-incremental.php'; | |
| 154 | - } | |
| 155 | - } else { | |
| 156 | - if ( file_exists( $admin_path . 'cron-create-full-backup.php' ) ) { | |
| 157 | - include_once $admin_path . 'cron-create-full-backup.php'; | |
| 158 | - } | |
| 159 | - } | |
| 160 | - if ( file_exists( $includes_path . 'class-wpdbfullbackuplog.php' ) ) { | |
| 161 | - include_once $includes_path . 'class-wpdbfullbackuplog.php'; | |
| 162 | - } | |
| 163 | - | |
| 164 | - } | |
| 165 | 124 | /** |
| 166 | 125 | * Installation setting at time of activation. |
| 167 | 126 | */ |
| 168 | 127 | public function installation($flag=1) { |
| 169 | - add_option( 'wp_db_backup_destination_SFTP', 0 , '' , false ); | |
| 170 | - add_option( 'wp_db_backup_destination_FTP', 0 , '' , false ); | |
| 171 | - add_option( 'wp_db_backup_destination_Email',0 , '' , false ); | |
| 172 | - add_option( 'wp_db_backup_destination_s3', 0 , '' , false ); | |
| 173 | - add_option( 'wp_db_remove_local_backup', 0 , '' , false ); | |
| 174 | - add_option( 'wp_db_remove_on_uninstall', 0 , '' , false ); | |
| 175 | - add_option('wp_db_backup_backup_type','complete', '' , false ); | |
| 176 | - add_option('wp_db_backup_exclude_dir',"wp-content/backupwordpress-728d36f682-backups|.git|db-backup", '' , false ); | |
| 177 | - add_option('wp_db_backup_backups_dir','db-backup', '' , false ); | |
| 178 | - add_option('bb_last_backup_timestamp',0, '' , false ); | |
| 179 | - add_option('wp_db_backup_sftp_details',null, '' , false ); | |
| 180 | - | |
| 128 | + add_option( 'wp_db_backup_destination_SFTP', 0 ,false); | |
| 129 | + add_option( 'wp_db_backup_destination_FTP', 0 ,false); | |
| 130 | + add_option( 'wp_db_backup_destination_Email', 0,false); | |
| 131 | + add_option( 'wp_db_backup_destination_s3', 0 ,false); | |
| 132 | + add_option( 'wp_db_remove_local_backup', 0 ,false); | |
| 133 | + add_option('wp_db_backup_backup_type','complete',false); | |
| 134 | + add_option('wp_db_backup_exclude_dir',"wp-content/backupwordpress-728d36f682-backups|.git|db-backup",false); | |
| 135 | + add_option('wp_db_backup_backups_dir','db-backup',false); | |
| 181 | 136 | if($flag!=2){ |
| 182 | - add_option( 'wpdbbkp_activation_redirect', true, '' , false ); | |
| 137 | + add_option( 'wpdbbkp_activation_redirect', true,false); | |
| 183 | 138 | } |
| 184 | - | |
| 185 | - $this->create_processed_files_table(); | |
| 186 | 139 | } |
| 187 | 140 | |
| 188 | 141 | /** |
| 189 | 142 | * Logger. |
| @@ -190,31 +143,8 @@ | ||
| 190 | 143 | */ |
| 191 | 144 | public function logger() { |
| 192 | 145 | _deprecated_function( 'Wpekaplugin->logger', '1.0', 'new WPDB_Logger()' ); |
| 193 | 146 | return new WPDB_Logger(); |
| 194 | - } | |
| 195 | - | |
| 196 | - public function create_processed_files_table() { | |
| 197 | - global $wpdb; | |
| 198 | - $table_name = $wpdb->prefix . 'wpdbbkp_processed_files'; | |
| 199 | - $charset_collate = $wpdb->get_charset_collate(); | |
| 200 | - | |
| 201 | - // Check if the table already exists | |
| 202 | - //phpcs:ignore -- Reason: Direct SQL execution is required here. | |
| 203 | - if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { | |
| 204 | - //phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange | |
| 205 | - $sql = "CREATE TABLE $table_name ( | |
| 206 | - id mediumint(9) NOT NULL AUTO_INCREMENT, | |
| 207 | - file_path text NOT NULL, | |
| 208 | - processed_at TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 209 | - status ENUM('added', 'updated', 'deleted') DEFAULT 'added' NOT NULL, | |
| 210 | - PRIMARY KEY (id), | |
| 211 | - UNIQUE (file_path(250)) | |
| 212 | - ) $charset_collate;"; | |
| 213 | - | |
| 214 | - require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); | |
| 215 | - dbDelta($sql); | |
| 216 | - } | |
| 217 | 147 | } |
| 218 | 148 | } |
| 219 | 149 | |
| 220 | 150 | endif; |