Skip to content

Commit fd36a92

Browse files
committed
Release 5.2.1
1 parent 1dd2228 commit fd36a92

File tree

6 files changed

+82
-28
lines changed

6 files changed

+82
-28
lines changed

backwpup.php

Lines changed: 2 additions & 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.2.0
8+
* Version: 5.2.1
99
* Requires at least: 4.9
1010
* Requires PHP: 7.4
1111
* Text Domain: backwpup
@@ -58,6 +58,7 @@ private function __construct()
5858
}
5959

6060
require_once __DIR__ . '/inc/functions.php';
61+
require_once __DIR__ . '/src/compat.php';
6162

6263
$file = untrailingslashit( self::get_plugin_data( 'plugindir' ) )
6364
. '/src/Infrastructure/Restore/commons.php';

changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
== Changelog ==
2+
= 5.2.1 =
3+
Release date: April 30, 2025
4+
5+
* Bugfix: Fixed fatal error caused by cal_days_in_month() function on 5.2 for unsupported servers.
6+
27
= 5.2.0 =
38
Release date: April 29, 2025
49

inc/functions.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,27 @@ function backwpup_esc_url_default_secure($url, $protocols = null)
234234

235235
return $escaped_url;
236236
}
237+
238+
/**
239+
* Compatibility code for cal_days_in_month.
240+
*
241+
* @param int $month Month.
242+
* @param int $year Year.
243+
*
244+
* @return int
245+
*/
246+
function backwpup_cal_days_in_month( $month, $year ) {
247+
$month = (int) $month;
248+
$year = (int) $year;
249+
250+
// Array of the number of days in each month for a non-leap year.
251+
$days_in_months = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
252+
253+
// Check if the month is February and if the year is a leap year.
254+
if ( 2 === $month && ( ( 0 === ( $year % 4 ) && 0 !== ( $year % 100 ) ) || ( 0 === $year % 400 ) ) ) {
255+
return 29; // February in a leap year has 29 days.
256+
}
257+
258+
// Return the number of days for the given month.
259+
return $days_in_months[ $month - 1 ];
260+
}

languages/backwpup.pot

Lines changed: 21 additions & 21 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-04-29 13:13+0000\n"
9+
"POT-Creation-Date: 2025-04-30 12:53+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"
@@ -34,83 +34,83 @@ msgstr ""
3434
msgid "https://backwpup.com"
3535
msgstr ""
3636

37-
#: backwpup.php:388, inc/class-page-backups.php:223
37+
#: backwpup.php:389, inc/class-page-backups.php:223
3838
msgid "Folder"
3939
msgstr ""
4040

41-
#: backwpup.php:389
41+
#: backwpup.php:390
4242
msgid "Backup to Folder"
4343
msgstr ""
4444

45-
#: backwpup.php:403
45+
#: backwpup.php:404
4646
msgid "Email"
4747
msgstr ""
4848

49-
#: backwpup.php:404
49+
#: backwpup.php:405
5050
msgid "Backup sent via email"
5151
msgstr ""
5252

53-
#: backwpup.php:418
53+
#: backwpup.php:419
5454
msgid "FTP"
5555
msgstr ""
5656

57-
#: backwpup.php:419
57+
#: backwpup.php:420
5858
msgid "Backup to FTP"
5959
msgstr ""
6060

61-
#: backwpup.php:433, inc/class-destination-dropbox.php:471
61+
#: backwpup.php:434, inc/class-destination-dropbox.php:471
6262
msgid "Dropbox"
6363
msgstr ""
6464

65-
#: backwpup.php:434, inc/class-page-about.php:504
65+
#: backwpup.php:435, inc/class-page-about.php:504
6666
msgid "Backup to Dropbox"
6767
msgstr ""
6868

69-
#: backwpup.php:448, inc/class-destination-s3.php:42, parts/sidebar/storage-S3.php:51
69+
#: backwpup.php:449, inc/class-destination-s3.php:42, parts/sidebar/storage-S3.php:51
7070
msgid "S3 Service"
7171
msgstr ""
7272

73-
#: backwpup.php:449
73+
#: backwpup.php:450
7474
msgid "Backup to an S3 Service"
7575
msgstr ""
7676

77-
#: backwpup.php:463
77+
#: backwpup.php:464
7878
msgid "MS Azure"
7979
msgstr ""
8080

81-
#: backwpup.php:464
81+
#: backwpup.php:465
8282
msgid "Backup to Microsoft Azure (Blob)"
8383
msgstr ""
8484

85-
#: backwpup.php:478
85+
#: backwpup.php:479
8686
msgid "RSC"
8787
msgstr ""
8888

89-
#: backwpup.php:479, inc/class-page-about.php:509
89+
#: backwpup.php:480, inc/class-page-about.php:509
9090
msgid "Backup to Rackspace Cloud Files"
9191
msgstr ""
9292

93-
#: backwpup.php:493
93+
#: backwpup.php:494
9494
msgid "SugarSync"
9595
msgstr ""
9696

97-
#: backwpup.php:494, inc/class-page-about.php:524
97+
#: backwpup.php:495, inc/class-page-about.php:524
9898
msgid "Backup to SugarSync"
9999
msgstr ""
100100

101-
#: backwpup.php:522
101+
#: backwpup.php:523
102102
msgid "PHP Version %1$s is to low, you need Version %2$s or above."
103103
msgstr ""
104104

105-
#: backwpup.php:536
105+
#: backwpup.php:537
106106
msgid "Missing function \"%s\"."
107107
msgstr ""
108108

109-
#: backwpup.php:551
109+
#: backwpup.php:552
110110
msgid "Missing class \"%s\"."
111111
msgstr ""
112112

113-
#: backwpup.php:637
113+
#: backwpup.php:638
114114
msgid "BackWPup requires PHP version %1$s with spl extension or greater and WordPress %2$s or greater."
115115
msgstr ""
116116

src/compat.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
defined( 'ABSPATH' ) || exit;
3+
4+
// Make sure CAL_GREGORIAN defined.
5+
if ( ! defined( 'CAL_GREGORIAN' ) ) {
6+
define( 'CAL_GREGORIAN', 1 );
7+
}
8+
9+
// Sometimes we will not find this function because calendar extension is not enabled, rare case but this happens.
10+
if ( ! function_exists( 'cal_days_in_month' ) ) {
11+
12+
/**
13+
* Compatibility code for cal_days_in_month.
14+
*
15+
* @param int $calendar Only accepts GREGORIAN.
16+
* @param int $month Month.
17+
* @param int $year Year.
18+
*
19+
* @return int
20+
*/
21+
function cal_days_in_month( $calendar, $month, $year ) {
22+
return backwpup_cal_days_in_month( $month, $year );
23+
}
24+
}

vendor/composer/installed.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php return array(
22
'root' => array(
33
'name' => 'inpsyde/backwpup-pro',
4-
'pretty_version' => '5.2.0',
5-
'version' => '5.2.0.0',
6-
'reference' => '24fa7ddc3a8a0d72683a8fdedc55a492c56ac532',
4+
'pretty_version' => '5.2.1',
5+
'version' => '5.2.1.0',
6+
'reference' => '5f22f5b2473dd0da1733bf536eb9b3f7cf04cd14',
77
'type' => 'wordpress-plugin',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -224,9 +224,9 @@
224224
'dev_requirement' => false,
225225
),
226226
'inpsyde/backwpup-pro' => array(
227-
'pretty_version' => '5.2.0',
228-
'version' => '5.2.0.0',
229-
'reference' => '24fa7ddc3a8a0d72683a8fdedc55a492c56ac532',
227+
'pretty_version' => '5.2.1',
228+
'version' => '5.2.1.0',
229+
'reference' => '5f22f5b2473dd0da1733bf536eb9b3f7cf04cd14',
230230
'type' => 'wordpress-plugin',
231231
'install_path' => __DIR__ . '/../../',
232232
'aliases' => array(),

0 commit comments

Comments
 (0)