• Resolved AndyHenderson

    (@andyhenderson)


    I run several not-for-profit sites that use your sitemap generator plugin. Until recently it has worked very well for us – and better than the WP intrinsic generator.

    However we are seeing the following warning in all our sites (currently using version 4.1.5):

    [18-Jul-2022 04:52:31 UTC] PHP Warning: A non-numeric value encountered in /homepages/9/d499301548/htdocs/clickandbuilds/WordPress/MyBlog/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 493

    At the failing line $offset and $taxonomy are both “category”. With that passed as a parameter to build_taxonomies, the warning is inevitable. It looks like there should be an ‘else’ condition in the opening ‘if’ statement.

    The problem started, from memory, a couple of months ago.

    We are running WordPress 6.0.1 but we also saw the problem under 5.9.

    The problem doesn’t occur on every sitemap.xml request, however. Perhaps due to caching?

    In our settings we have ‘include categories’ ticked and one category excluded.

    Let me know if I can provide more information.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter AndyHenderson

    (@andyhenderson)

    I’ve trapped the same error in a different site. This time $offset and $taxonomy are both “activity”. That’s a custom category related to a custom post type.

    Andy

    Thread Starter AndyHenderson

    (@andyhenderson)

    This time I managed to produce a stack trace. On this occasion, $offset and $taxonomy were both “u3acategory” – a custom category associated with a custom post type:

    [23-Jul-2022 00:57:56 UTC] #0 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php(44): GoogleSitemapGeneratorStandardBuilder->build_taxonomies(Object(GoogleSitemapGenerator), 'u3acategory')
    #1 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/class-wp-hook.php(307): GoogleSitemapGeneratorStandardBuilder->content(Object(GoogleSitemapGenerator), 'tax', 'u3acategory')
    #2 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #3 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #4 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/sitemap-core.php(1961): do_action('sm_build_conten...', Object(GoogleSitemapGenerator), 'tax', 'u3acategory')
    #5 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorloader.php(387): GoogleSitemapGenerator->show_sitemap(Array)
    #6 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorloader.php(250): GoogleSitemapGeneratorLoader::call_show_sitemap('params=tax-u3ac...')
    #7 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/class-wp-hook.php(305): GoogleSitemapGeneratorLoader::do_template_redirect()
    #8 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #9 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #10 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-includes/template-loader.php(13): do_action('template_redire...')
    #11 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-blog-header.php(19): require_once('/homepages/0/d8...')
    #12 /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/index.php(17): require('/homepages/0/d8...')
    #13 {main}
    [23-Jul-2022 00:57:56 UTC] PHP Warning: A non-numeric value encountered in /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 493
    Thread Starter AndyHenderson

    (@andyhenderson)

    The code referenced above is also disrupted when passed a taxonomy with a hyphen. Given taxonomy event-venue (as generated by popular plugin Event Organiser) $taxonomy becomes “event” and offset becomes “venue”.

    Andy

    Thanks for reaching out to us. We have tracked the issue. The new version deployment is on the card, once you update to the latest version, the issue will be fixed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Warning in class-googlesitemapgeneratorstandardbuilder.php’ is closed to new replies.