• sao987

    (@sao987)


    Hi, currently my site is getting the following errors:

    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

    Warning: Undefined variable $backgroundcolor in /var/www/domain.com/wp-content/plugins/google-calendar-events/includes/feeds/google.php on line 594

    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

    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

    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

    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

    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

    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

    Environment:

    OS: Debian 12 Linux 6.1.0 ARM64
    Server: nginx/1.26.1
    PHP version: 8.2.20
    WordPress Version: 6.6.2

    Any plan to fix?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support john

    (@johnweru)

    Hi there,

    Thanks for reaching out to us.

    In regards to the warning and deprecation messages, we will be fixing these in a future update. Kindly bear with us. As for now, I would recommend disabling error reporting as outlined here: https://developer.www.ads-software.com/advanced-administration/debug/debug-wordpress/ .

    My apologies for the inconvenience caused.

    Kind Regards

    Plugin Support john

    (@johnweru)

    Hi there,

    Just a quick update on this. We released an update addressing this matter (Simple Calendar version 3.4.4).

    Let us know if you are still encountering these specific deprecation notices.

    Kind Regards

    Thread Starter sao987

    (@sao987)

    @johnweru

    I can confirm that I still get

    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

    after the update.

    Plugin Support john

    (@johnweru)

    Hi there,

    Thanks for keeping in touch with us.

    In this case, please ensure that you clear your calendar cache as outlined here and refresh your calendar. If this does not help, please share with us screenshots on your calendar settings as well as a screenshot illustrating where you are encountering the notice.

    We look forward to your reply.

    Kind Regards

    Thread Starter sao987

    (@sao987)

    @johnweru

    I have cleared the cache as per your instructions. I got it in the WP_DEBUG_LOG. There are no special settings for my calendar, and since it’s a PHP deprecation notice, I don’t think the settings are relevant.

    [23-Oct-2024 12:15:46 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

    Plugin Support john

    (@johnweru)

    Hi there,

    Thanks for keeping in touch with us.

    In this case, I do not seem to replicate the warning from my end. I have however notified the development team about this so that they can look further into this.

    Kind Regards

    Thread Starter sao987

    (@sao987)

    @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

    Plugin Support john

    (@johnweru)

    Hi there,

    Thanks for keeping in touch with us and clearly elaborating about this.

    In this case, I have notified our development team to look into these deprecation messages. We will keep you posted once an update addressing them is ready.

    Kindly bear with us in the meantime.

    Regards

    • This reply was modified 4 weeks ago by john.
Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.