• Resolved Mikhail Alferov

    (@malferov)


    In sitemap-core.php file uses set_time_limit() function, that accept the single integer-argument $second. But classe’s method get_option() may return null for some cases and then error_log shows deprecated notice:

    PHP Deprecated: set_time_limit(): Passing null to parameter #1 ($seconds) of type int is deprecated in google-sitemap-generator/sitemap-core.php

    I suppose type casting will solve this little problem:

    set_time_limit( (int) $this->get_option( ‘b_time’ ) )

Viewing 7 replies - 1 through 7 (of 7 total)
  • @malferov, thankyou for contacting us.

    We will track this and get manage it in backlog.

    @malferov Please check and verify

    if you have entered a string value in plugin setting for

    1. Try to increase the memory limit to
    2. Try to increase the execution time limit to

    change it to integer if inserted string value.

    Thread Starter Mikhail Alferov

    (@malferov)

    @saurabhdhariwal01 These fields are empty in my case.

    @malferov , we will track this meanwhile please input

    Memory limit: 16
    Execution time limit: 60

    Thread Starter Mikhail Alferov

    (@malferov)

    My memory limit is 1024M, and max_execution_time is 120. But that doesn’t solve the problem.

    If dirrect access to the XML-file like: {domain.tld}/sitemap-pt-post-p1-2022-10.xml and log debug info before call the set_time_limit(), then got this:

    \GoogleSitemapGenerator::__set_state(array(
    
    'options' => array (),
    
        'pages' => array (),
    
        'freq_names' => array (),
    
        'prio_providers' => array (),
    
        'is_initiated' => false,
    
        'is_active' => false,
    
        'build_options' => array (),
    
        'ui' => NULL,
    
        'sim_mode' => false,
    
        'sim_data' => array (
    
            'sitemaps' =>array (),
    
            'content' => array (),
    
        ),
    
        'options_loaded' => false,
    
    ))
    Thread Starter Mikhail Alferov

    (@malferov)

    @saurabhdhariwal01 I suppose that the show_sitemap() funciton in the sitemap-core.php file called before initializing options.

    Probably need either a) initiate the options inside the function show_sitemap() (at beginning) or b) initiate the options after the plugin loaded but before calling the show_sitemap().

    @malferov,

    we will track this and manage it in future release

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘set_time_limit(): Passing null to parameter #1 ($seconds) of type int’ is closed to new replies.