@johnweru
Hi, just to let you know that other deprecation notices also appear occasionally, for example, here:
[24-Oct-2024 15:49:49 UTC] PHP Deprecated: timezone_name_from_abbr(): Passing null to parameter #1 ($abbr) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/functions/shared.php on line 376
[24-Oct-2024 15:49:54 UTC] PHP Deprecated: timezone_name_from_abbr(): Passing null to parameter #1 ($abbr) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/functions/shared.php on line 376
[24-Oct-2024 15:50:08 UTC] PHP Deprecated: timezone_name_from_abbr(): Passing null to parameter #1 ($abbr) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/functions/shared.php on line 376
[24-Oct-2024 15:50:09 UTC] PHP Deprecated: timezone_name_from_abbr(): Passing null to parameter #1 ($abbr) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/functions/shared.php on line 376
[24-Oct-2024 15:50:11 UTC] PHP Deprecated: timezone_name_from_abbr(): Passing null to parameter #1 ($abbr) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/functions/shared.php on line 376
[24-Oct-2024 15:50:11 UTC] PHP Deprecated: timezone_name_from_abbr(): Passing null to parameter #1 ($abbr) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/functions/shared.php on line 376
[24-Oct-2024 15:50:12 UTC] PHP Deprecated: timezone_name_from_abbr(): Passing null to parameter #1 ($abbr) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/functions/shared.php on line 376
[24-Oct-2024 15:50:14 UTC] PHP Deprecated: timezone_name_from_abbr(): Passing null to parameter #1 ($abbr) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/functions/shared.php on line 376
[24-Oct-2024 15:50:15 UTC] PHP Deprecated: mb_detect_encoding(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/feeds/google.php on line 198
[24-Oct-2024 15:50:15 UTC] PHP Deprecated: iconv(): Passing null to parameter #3 ($string) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/feeds/google.php on line 197
[24-Oct-2024 15:50:15 UTC] PHP Deprecated: mb_detect_encoding(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/feeds/google.php on line 198
[24-Oct-2024 15:50:15 UTC] PHP Deprecated: iconv(): Passing null to parameter #3 ($string) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/feeds/google.php on line 197
[24-Oct-2024 15:50:15 UTC] PHP Deprecated: mb_detect_encoding(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/feeds/google.php on line 198
[24-Oct-2024 15:50:15 UTC] PHP Deprecated: iconv(): Passing null to parameter #3 ($string) of type string is deprecated in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/feeds/google.php on line 197
So whatever the fix was, it does not seem to solve the problem.
As you can see, the code is still null on line 376 for shared.php:
function simcal_get_timezone_from_gmt_offset($offset)
{
if (is_numeric($offset)) {
if (0 === intval($offset)) {
return 'UTC';
} else {
$offset = floatval($offset) * 3600;
}
$timezone = timezone_name_from_abbr(null, $offset, false);
// This is buggy and might return false:
// @see https://php.net/manual/en/function.timezone-name-from-abbr.php#86928
// Therefore:
if (false == $timezone) {
$list = timezone_abbreviations_list();
foreach ($list as $abbr) {
foreach ($abbr as $city) {
if ($offset == $city['offset']) {
return $city['timezone_id'];
}
}
}
}
return $timezone;
}
return null;
}
So does google.php, also is still using null parameter:
// Event title & description.
$title = strip_tags($event->getSummary());
$title = sanitize_text_field(iconv(mb_detect_encoding($title, mb_detect_order(), true), 'UTF-8', $title));
$description = wp_kses_post(
iconv(
mb_detect_encoding($event->getDescription(), mb_detect_order(), true),
'UTF-8',
$event->getDescription()
)
);
$whole_day = false;
// Event start properties.
if ('use_calendar' == $this->timezone_setting) {
$start_timezone = !$event->getStart()->timeZone ? $calendar['timezone'] : $event->getStart()->timeZone;
} else {
$start_timezone = $this->timezone;
}
if (is_null($event->getStart()->dateTime)) {
// Whole day event.
$date = Carbon::parse($event->getStart()->date);
$google_start = Carbon::createFromDate($date->year, $date->month, $date->day, $start_timezone)
->startOfDay()
->addSeconds(59);
$google_start_utc = Carbon::createFromDate($date->year, $date->month, $date->day, 'UTC')
->startOfDay()
->addSeconds(59);
$whole_day = true;
Passing null to parameter is deprecated since php 8.1