Skip to content

Commit 764aadd

Browse files
committed
Release 5.0.9
1 parent 1ac32df commit 764aadd

File tree

8 files changed

+56
-20858
lines changed

8 files changed

+56
-20858
lines changed

backwpup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: WordPress Backup Plugin
66
* Author: BackWPup – WordPress Backup & Restore Plugin
77
* Author URI: https://backwpup.com
8-
* Version: 5.0.8
8+
* Version: 5.0.9
99
* Requires at least: 4.9
1010
* Requires PHP: 7.4
1111
* Text Domain: backwpup

changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
== Changelog ==
2+
= 5.0.9 =
3+
Release date: March 21, 2025
4+
5+
* Fixed: Huge package size
6+
* Fixed: Files and DB jobs are not separated in certain scenario
7+
28
= 5.0.8 =
39
Release date: March 20, 2025
410

inc/class-wp-api.php

Lines changed: 9 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -719,106 +719,16 @@ public function update_job( WP_REST_Request $request ): WP_HTTP_Response {
719719
$status = 200;
720720
if ( isset( $params['job_id'] ) && isset( $params['activ'] ) ) {
721721
// Extract parameters from the request.
722-
$file_job_id = get_site_option( 'backwpup_backup_files_job_id', false ); // Get the ID of the file job.
723-
$database_job_id = get_site_option( 'backwpup_backup_database_job_id', false ); // Get the ID of the database job.
724-
$activ = filter_var( $params['activ'], FILTER_VALIDATE_BOOLEAN ); // Determine if the job is being activated or deactivated.
725-
$type = $params['type']; // Get the type of job (either 'files' or 'database').
726-
727-
// CASE 1: Files type job.
728-
if ( 'files' === $type ) {
729-
if ( $file_job_id === $database_job_id ) {
730-
// Case where file job also handles database backups.
731-
if ( ! $activ ) {
732-
// Disable the file job, enable a new database job to handle the backup.
733-
BackWPup_Job::disable_job( $file_job_id );
734-
BackWPup_Job::rename_job( $file_job_id, BackWPup_JobTypes::$name_job_files ); // Rename the file job.
735-
$new_database_job_id = $file_job_id + 1; // Use the next ID for the database job.
736-
BackWPup_Option::update( $file_job_id, 'type', BackWPup_JobTypes::$type_job_files ); // Mark the file job as handling only file backups.
737-
BackWPup_Job::enable_job( $new_database_job_id ); // Enable the new database job.
738-
update_site_option( 'backwpup_backup_database_job_id', $new_database_job_id ); // Update the stored database job ID.
739-
BackWPup_Job::schedule_job( $new_database_job_id ); // Schedule the new database backup job.
740-
} elseif ( BackWPup_Job::is_job_enabled( $database_job_id ) ) {
741-
BackWPup_Job::disable_job( $database_job_id ); // Disable the database job.
742-
update_site_option( 'backwpup_backup_database_job_id', $file_job_id ); // Update the database job ID to point to the file job.
743-
BackWPup_Option::update( $file_job_id, 'type', BackWPup_JobTypes::$type_job_both ); // Mark the file job to handle both file and database backups.
744-
BackWPup_Job::enable_job( $file_job_id ); // Enable the file job.
745-
BackWPup_Job::schedule_job( $file_job_id ); // Schedule the file job.
746-
BackWPup_Job::rename_job( $file_job_id, BackWPup_JobTypes::$name_job_both ); // Rename the file job.
747-
} else {
748-
BackWPup_Job::enable_job( $file_job_id ); // Enable the file job.
749-
BackWPup_Job::schedule_job( $file_job_id ); // Schedule the file job.
750-
}
751-
} else { // @phpcs:ignore
752-
// Case where file and database jobs are independent.
753-
if ( $activ ) {
754-
// Enable file job and disable database job if necessary.
755-
if ( BackWPup_Job::is_job_enabled( $database_job_id ) ) {
756-
BackWPup_Option::update( $file_job_id, 'type', BackWPup_JobTypes::$type_job_files );
757-
if ( BackWPup_Option::get( $file_job_id, 'cron' ) === BackWPup_Option::get( $database_job_id, 'cron' ) ) {
758-
// If both jobs share the same cron schedule, update file job to handle both backups.
759-
BackWPup_Option::update( $file_job_id, 'type', BackWPup_JobTypes::$type_job_both );
760-
update_site_option( 'backwpup_backup_database_job_id', $file_job_id ); // Update the database job ID.
761-
BackWPup_Job::rename_job( $file_job_id, BackWPup_JobTypes::$name_job_both ); // Rename the file job.
762-
BackWPup_Job::disable_job( $database_job_id ); // Disable the database job.
763-
}
764-
} else {
765-
// If the file job is not yet enabled, just set it to handle both jobs.
766-
BackWPup_Option::update( $file_job_id, 'type', BackWPup_JobTypes::$type_job_files );
767-
}
768-
BackWPup_Job::enable_job( $file_job_id ); // Enable the file job.
769-
BackWPup_Job::schedule_job( $file_job_id );
770-
} elseif ( ! $activ ) {
771-
// Disable file job if not activated.
772-
BackWPup_Job::disable_job( $file_job_id );
773-
}
774-
}
775-
}
722+
$job_id = (int) $params['job_id']; // The job ID.
723+
$activ = filter_var( $params['activ'], FILTER_VALIDATE_BOOLEAN ); // Determine if the job is being activated or deactivated.
776724

777-
// CASE 2: Database type job.
778-
elseif ( 'database' === $type ) {
779-
BackWPup_Job::rename_job( $file_job_id + 1, BackWPup_JobTypes::$name_job_database ); // Rename the database job.
780-
if ( $file_job_id === $database_job_id ) {
781-
// Case where file job is also the database job.
782-
if ( ! $activ ) {
783-
// Disable DB job, make file job only handle file.
784-
BackWPup_Option::update( $file_job_id, 'type', BackWPup_JobTypes::$type_job_files );
785-
BackWPup_Job::rename_job( $file_job_id, BackWPup_JobTypes::$name_job_files ); // Rename the file job.
786-
787-
} elseif ( BackWPup_Job::is_job_enabled( $file_job_id ) ) {
788-
// Enable DB job, set file to handle both.
789-
BackWPup_Option::update( $file_job_id, 'type', BackWPup_JobTypes::$type_job_both );
790-
BackWPup_Job::rename_job( $file_job_id, BackWPup_JobTypes::$name_job_both ); // Rename the file job.
791-
} else {
792-
$new_database_job_id = $file_job_id + 1;
793-
BackWPup_Job::enable_job( $new_database_job_id );
794-
BackWPup_Job::schedule_job( $new_database_job_id );
795-
}
796-
} else { // @phpcs:ignore
797-
// Case where file and database jobs are independent.
798-
if ( $activ ) {
799-
if ( BackWPup_Job::is_job_enabled( $file_job_id ) ) {
800-
// If file job is enabled, check if both jobs share the same cron schedule.
801-
if ( BackWPup_Option::get( $file_job_id, 'cron' ) === BackWPup_Option::get( $database_job_id, 'cron' ) ) {
802-
// If they share the same cron, update the file job to handle both backups.
803-
BackWPup_Option::update( $file_job_id, 'type', BackWPup_JobTypes::$type_job_both );
804-
update_site_option( 'backwpup_backup_database_job_id', $file_job_id ); // Update the database job ID.
805-
BackWPup_Job::rename_job( $file_job_id, BackWPup_JobTypes::$name_job_both ); // Rename the file job.
806-
} else {
807-
// If cron schedules differ, just set the file job to handle both jobs.
808-
BackWPup_Option::update( $file_job_id, 'type', BackWPup_JobTypes::$type_job_files );
809-
BackWPup_Job::enable_job( $database_job_id );
810-
BackWPup_Job::schedule_job( $database_job_id );
811-
}
812-
} else {
813-
// If the file job isn't enabled, ensure that the database job is enabled.
814-
BackWPup_Job::enable_job( $database_job_id );
815-
BackWPup_Job::schedule_job( $database_job_id );
816-
}
817-
} elseif ( ! $activ ) {
818-
// If not activating the database job, disable it.
819-
BackWPup_Job::disable_job( $database_job_id );
820-
}
821-
}
725+
if ( $activ ) {
726+
// Enable and schedule the job.
727+
BackWPup_Job::enable_job( $job_id );
728+
BackWPup_Job::schedule_job( $job_id );
729+
} else {
730+
// Disable the job.
731+
BackWPup_Job::disable_job( $job_id );
822732
}
823733

824734
// Set response message based on activation status.

languages/backwpup.pot

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgstr ""
66
"MIME-Version: 1.0\n"
77
"Content-Type: text/plain; charset=UTF-8\n"
88
"Content-Transfer-Encoding: 8bit\n"
9-
"POT-Creation-Date: 2025-03-20 16:02+0000\n"
9+
"POT-Creation-Date: 2025-03-21 10:15+0000\n"
1010
"X-Poedit-Basepath: ..\n"
1111
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
1212
"X-Poedit-SearchPath-0: .\n"
@@ -154,7 +154,7 @@ msgstr ""
154154
msgid "Advanced settings"
155155
msgstr ""
156156

157-
#: components/selector-file-db.php:65, parts/backups/next-scheduled-backup.php:125
157+
#: components/selector-file-db.php:65, parts/backups/next-scheduled-backup.php:126
158158
msgid "Database"
159159
msgstr ""
160160

@@ -178,7 +178,7 @@ msgstr ""
178178
msgid "Stored on"
179179
msgstr ""
180180

181-
#: components/table-backups.php:19, components/table-row-backups.php:81, parts/backups/next-scheduled-backup.php:89, parts/backups/next-scheduled-backup.php:148
181+
#: components/table-backups.php:19, components/table-row-backups.php:81, parts/backups/next-scheduled-backup.php:89, parts/backups/next-scheduled-backup.php:149
182182
msgid "Data"
183183
msgstr ""
184184

@@ -270,7 +270,7 @@ msgstr ""
270270
msgid "Cheating, huh?"
271271
msgstr ""
272272

273-
#: inc/class-admin.php:848, inc/class-wp-api.php:839, inc/class-wp-api.php:887, inc/class-wp-api.php:1257, inc/Pro/Settings/EncryptionSettingUpdater.php:107
273+
#: inc/class-admin.php:848, inc/class-wp-api.php:749, inc/class-wp-api.php:797, inc/class-wp-api.php:1167, inc/Pro/Settings/EncryptionSettingUpdater.php:107
274274
msgid "Files job not found"
275275
msgstr ""
276276

@@ -2575,7 +2575,7 @@ msgid "?"
25752575
msgstr ""
25762576

25772577
#. translators: %1$s is the date, %2$s is the time.
2578-
#: inc/class-page-backups.php:351, inc/class-page-backwpup.php:321, inc/class-page-backwpup.php:384, inc/class-page-jobs.php:297, inc/class-page-jobs.php:334, inc/class-page-logs.php:201, inc/class-wp-api.php:1039, parts/backups/next-scheduled-backup.php:28, parts/backups/next-scheduled-backup.php:38
2578+
#: inc/class-page-backups.php:351, inc/class-page-backwpup.php:321, inc/class-page-backwpup.php:384, inc/class-page-jobs.php:297, inc/class-page-jobs.php:334, inc/class-page-logs.php:201, inc/class-wp-api.php:949, parts/backups/next-scheduled-backup.php:28, parts/backups/next-scheduled-backup.php:38
25792579
msgid "%1$s at %2$s"
25802580
msgstr ""
25812581

@@ -3293,7 +3293,7 @@ msgid "Job \"%1$s\" has started, but not responded for 10 seconds. Please check
32933293
msgstr ""
32943294

32953295
#. translators: Job name
3296-
#: inc/class-page-jobs.php:527, inc/class-wp-api.php:983
3296+
#: inc/class-page-jobs.php:527, inc/class-wp-api.php:893
32973297
msgid "Job \"%s\" started."
32983298
msgstr ""
32993299

@@ -4078,88 +4078,88 @@ msgstr ""
40784078
msgid "No pagination found."
40794079
msgstr ""
40804080

4081-
#: inc/class-wp-api.php:853
4081+
#: inc/class-wp-api.php:763
40824082
msgid "Backup updated."
40834083
msgstr ""
40844084

4085-
#: inc/class-wp-api.php:827
4085+
#: inc/class-wp-api.php:737
40864086
msgid "Backup scheduled at %1$s"
40874087
msgstr ""
40884088

4089-
#: inc/class-wp-api.php:831, parts/backups/next-scheduled-backup.php:18, parts/backups/next-scheduled-backup.php:19
4089+
#: inc/class-wp-api.php:741, parts/backups/next-scheduled-backup.php:18, parts/backups/next-scheduled-backup.php:19
40904090
msgid "No backup scheduled"
40914091
msgstr ""
40924092

4093-
#: inc/class-wp-api.php:877
4093+
#: inc/class-wp-api.php:787
40944094
msgid "Cloud not set"
40954095
msgstr ""
40964096

4097-
#: inc/class-wp-api.php:881
4097+
#: inc/class-wp-api.php:791
40984098
msgid "Cloud not found"
40994099
msgstr ""
41004100

4101-
#: inc/class-wp-api.php:903
4101+
#: inc/class-wp-api.php:813
41024102
msgid "Connection failed"
41034103
msgstr ""
41044104

4105-
#: inc/class-wp-api.php:905
4105+
#: inc/class-wp-api.php:815
41064106
msgid "Connection successful"
41074107
msgstr ""
41084108

4109-
#: inc/class-wp-api.php:1027
4109+
#: inc/class-wp-api.php:937
41104110
msgid "Failed to update option."
41114111
msgstr ""
41124112

4113-
#: inc/class-wp-api.php:1031
4113+
#: inc/class-wp-api.php:941
41144114
msgid "Failed to schedule job."
41154115
msgstr ""
41164116

41174117
#. translators: %s is the job type.
4118-
#: inc/class-wp-api.php:1045
4118+
#: inc/class-wp-api.php:955
41194119
msgid "%s settings saved successfully."
41204120
msgstr ""
41214121

4122-
#: inc/class-wp-api.php:1077
4122+
#: inc/class-wp-api.php:987
41234123
msgid "Site option saved successfully."
41244124
msgstr ""
41254125

4126-
#: inc/class-wp-api.php:1118
4126+
#: inc/class-wp-api.php:1028
41274127
msgid "Bulk action processed."
41284128
msgstr ""
41294129

4130-
#: inc/class-wp-api.php:1121
4130+
#: inc/class-wp-api.php:1031
41314131
msgid "Invalid action."
41324132
msgstr ""
41334133

4134-
#: inc/class-wp-api.php:1140
4134+
#: inc/class-wp-api.php:1050
41354135
msgid "Invalid backup data."
41364136
msgstr ""
41374137

4138-
#: inc/class-wp-api.php:1149
4138+
#: inc/class-wp-api.php:1059
41394139
msgid "Missing required parameters."
41404140
msgstr ""
41414141

4142-
#: inc/class-wp-api.php:1159
4142+
#: inc/class-wp-api.php:1069
41434143
msgid "Invalid destination class."
41444144
msgstr ""
41454145

4146-
#: inc/class-wp-api.php:1225
4146+
#: inc/class-wp-api.php:1135
41474147
msgid "Excluded tables saved successfully."
41484148
msgstr ""
41494149

4150-
#: inc/class-wp-api.php:1265
4150+
#: inc/class-wp-api.php:1175
41514151
msgid "File exclusions saved successfully."
41524152
msgstr ""
41534153

4154-
#: inc/class-wp-api.php:1290
4154+
#: inc/class-wp-api.php:1200
41554155
msgid "This feature is only available in the Pro version."
41564156
msgstr ""
41574157

4158-
#: inc/class-wp-api.php:1340
4158+
#: inc/class-wp-api.php:1250
41594159
msgid "No block name set."
41604160
msgstr ""
41614161

4162-
#: inc/class-wp-api.php:1343
4162+
#: inc/class-wp-api.php:1253
41634163
msgid "Wrong block type set."
41644164
msgstr ""
41654165

@@ -4323,7 +4323,7 @@ msgstr ""
43234323
msgid "Files backup scheduled"
43244324
msgstr ""
43254325

4326-
#: components/onboarding/step2.php:36, components/onboarding/step2.php:75, parts/backups/next-scheduled-backup.php:99, parts/backups/next-scheduled-backup.php:156, parts/sidebar/frequency-files.php:36, parts/sidebar/frequency-tables.php:35
4326+
#: components/onboarding/step2.php:36, components/onboarding/step2.php:75, parts/backups/next-scheduled-backup.php:99, parts/backups/next-scheduled-backup.php:158, parts/sidebar/frequency-files.php:36, parts/sidebar/frequency-tables.php:35
43274327
msgid "Frequency"
43284328
msgstr ""
43294329

@@ -5576,7 +5576,7 @@ msgstr ""
55765576
msgid "Next Scheduled Backups"
55775577
msgstr ""
55785578

5579-
#: parts/backups/next-scheduled-backup.php:108, parts/backups/next-scheduled-backup.php:164
5579+
#: parts/backups/next-scheduled-backup.php:108, parts/backups/next-scheduled-backup.php:167
55805580
msgid "Storage"
55815581
msgstr ""
55825582

parts/backups/next-scheduled-backup.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
"trigger" => "load-and-open-sidebar",
110110
"display" => "storages",
111111
"data" => ['job-id' => $file_job_id, 'block-type' => 'children', 'block-name' => 'sidebar/storages', ],
112+
"disabled" => !$file_activate,
112113
]);
113114
?>
114115
</p>
@@ -148,6 +149,7 @@
148149
"label" => __("Data", 'backwpup'),
149150
"trigger" => "open-sidebar",
150151
"display" => "select-tables",
152+
"disabled" => !$database_activate,
151153
]);
152154
?>
153155
<?php
@@ -156,6 +158,7 @@
156158
"label" => __("Frequency", 'backwpup'),
157159
"trigger" => "open-sidebar",
158160
"display" => $frequency_database,
161+
"disabled" => !$database_activate,
159162
]);
160163
?>
161164
<?php
@@ -164,7 +167,8 @@
164167
"label" => __("Storage", 'backwpup'),
165168
"trigger" => "load-and-open-sidebar",
166169
"display" => "storages",
167-
"data" => ['job-id' => $database_job_id, 'block-type' => 'children', 'block-name' => 'sidebar/storages', ]
170+
"data" => ['job-id' => $database_job_id, 'block-type' => 'children', 'block-name' => 'sidebar/storages', ],
171+
"disabled" => !$database_activate,
168172
]);
169173
?>
170174
</p>

0 commit comments

Comments
 (0)