• Resolved dimal

    (@dimalifragis)


    Hello. WP 6.4.x and PHP 8.1.x and above

    [29-Nov-2023 12:33:11 UTC] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/public_html/wp-content/plugins/google-site-kit/includes/Modules/Analytics_4/Report.php on line 112

    I do know that those are just future warnings.

    Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support Adam Dunnage

    (@adamdunnage)

    Hello @dimalifragis thank you for getting in touch and sharing the PHP error you have been alerted to. The first thing I’d like to check with you is do any of these seem to impact the performance or overall functionality of Site Kit or does the plugin still work as expected?

    If you are seeing issues with the plugin then please could I ask you to share your Site Health information. You can use this form to share privately if preferred. I can then check your setup to see if anything else stands out here.

    PHP 8 error warnings are not uncommon and something we are aware of. You can see more on this from our sticky post on the subject. I will however flag this to the team to ensure there isn’t anything of concern and if there is we will rest assured, get these addressed.

    Please let me know if you have any further questions.

    Thread Starter dimal

    (@dimalifragis)

    Hi, no other issues, just this notice. FYI.

    Thanks

    Plugin Support Adam Dunnage

    (@adamdunnage)

    @dimalifragis We appreciate you bringing this to our attention. If you do notice any issues with your Site Kit then please don’t hesitate to get back in touch and we will be happy to help.

    Thread Starter dimal

    (@dimalifragis)

    This is NOT fixed with this latest update.

    Plugin Support Adam Dunnage

    (@adamdunnage)

    @dimalifragis Thanks for the follow up. As stated above we are aware of these and they will be addressed in time. There is no timeframe but these are warnings and shouldn’t have any impact on the functionality of Site Kit at this time. If you do notice any issues with Site Kit then please do let us know and we will be happy to assist you with those.

    Otherwise, the team are aware of these and they will be addressed at some point in the future.

    Thread Starter dimal

    (@dimalifragis)

    Ok, so in between the future and now, if any one cares to fix that in his site:

    protected function parse_dateranges( Data_Request $data ) {
        $date_ranges = array();
        $start_date  = $data['startDate'];
        $end_date    = $data['endDate'];
        if ( strtotime( $start_date ) && strtotime( $end_date ) ) {
            $compare_start_date = $data['compareStartDate'];
            $compare_end_date   = $data['compareEndDate'];
            $date_ranges[]      = array( $start_date, $end_date );
    
            // When using multiple date ranges, it changes the structure of the response:
            // Aggregate properties (minimum, maximum, totals) will have an entry per date range.
            // The rows property will have additional row entries for each date range.
            if ( isset($compare_start_date, $compare_end_date) && strtotime( $compare_start_date ) && strtotime( $compare_end_date ) ) {
                $date_ranges[] = array( $compare_start_date, $compare_end_date );
            }
        } else {
            // Default the date range to the last 28 days.
            $date_ranges[] = Date::parse_date_range( 'last-28-days', 1 );
        }
    
        $date_ranges = array_map(
            function ( $date_range ) {
                list ( $start_date, $end_date ) = $date_range;
                $date_range                     = new Google_Service_AnalyticsData_DateRange();
                $date_range->setStartDate( $start_date );
                $date_range->setEndDate( $end_date );
    
                return $date_range;
            },
            $date_ranges
        );
    
        return $date_ranges;
    }
    
    Thread Starter dimal

    (@dimalifragis)

    I saw you closed as RESOLVED an other SAME topic as this.

    But this is not resolved.

    Plugin Support Adam Dunnage

    (@adamdunnage)

    @dimalifragis As mentioned above we are aware of these and intend to address them at some stage in the future.

    As stated before, if you notice these having an impact on your Site Kit then please do let us know and we can look into these instances with you.

    Thread Starter dimal

    (@dimalifragis)

    Ok, i’m removing this from my site and “at some stage in the future” i will reconsider it.

    Thanks

    Plugin Support Adam Dunnage

    (@adamdunnage)

    @dimalifragis Sorry to hear this. You can still use the Site Kit plugin with these notices and if you do notice any impact on the plugin performance then we can happily look at these with you.

    Thanks for your time with this and we hope you can give Site Kit another try in the future. All the best with your website!

    I have the same issue on a site which is under development with wp-debug running. This warning has been reported by others for some months. I understand the meaning of the warning and the replies that it does not impact on the functionaliity of the plugin and will be adressed in the future. However, the debug is needed for monitoring other issues and, when flooded with this warning, becomes difficult to sort through the log file. At present I will discontinue the use of Site Kit, but would like to know how soon it will be fixed, since previous answers were vague.

    Plugin Support Adam Dunnage

    (@adamdunnage)

    @malae Unfortunately I can’t give you a time frame on when these will be addressed but we are aware of these and will address them when we can.

    @adamdunnage
    Thank you for your reply. I guess you have until PHP 8.0 EOL in November 2024.

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.